hash command in Linux with examples
hash command in Linux system is the built-in command of bash which is used to maintain a hash table of recently executed programs. It remembers and shows the program locations. It will give the full pathname of each command name.
Syntax:
hash [-lr] [-p pathname] [-dt] [name ...]
Options:
- -d: This is used to forget the remembered location of each NAME.
- -l: It will display in a format that may be reused as input.
- -p: pathname use PATHNAME as the full pathname of NAME.
- -r: Forget all remembered locations.
- -t: To display the remembered location of each NAME, preceding each location with the corresponding NAME if multiple NAMEs are given.
Example 1: hash command without any option
hash

Example 2: hash command with -r option

Example 3: hash command with -l command
hash -l

Recommended Posts:
- rev command in Linux with Examples
- apt command in linux with examples
- if command in linux with examples
- seq command in Linux with Examples
- ip command in Linux with examples
- fg command in Linux with examples
- last command in Linux with Examples
- cal command in Linux with Examples
- ed command in Linux with examples
- du command in Linux with examples
- df command in Linux with Examples
- ZIP command in Linux with examples
- scp command in Linux with Examples
- bg command in Linux with Examples
- id command in Linux with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



