Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

hash command in Linux with examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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

My Personal Notes arrow_drop_up
Last Updated : 21 May, 2019
Like Article
Save Article
Similar Reads
Related Tutorials