Name
hash
Synopsis
hash [options] [commands]Search for commands and remember the
directory in which each command resides. Hashing causes the shell to
remember the association between a name and the absolute pathname of
an executable, so that future executions don’t
require a search of PATH. With no arguments or only -l, hash lists
the current hashed commands. The display shows
hits (the number of times the command is called
by the shell) and command (the full
pathname).
Options
- -d
Forget the remembered location of each specified command.
- -l
Display the output in a format that can be reused as input.
- -p
filename Assume
filenameis the full path to the command and don’t do a path search.- -r
Forget the locations of all remembered commands.
- -t
Print the full pathname for each command. With more than one command, print the command before each full path.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access