This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Hash" Unix – news ·newspapers ·books ·scholar ·JSTOR(December 2009) (Learn how and when to remove this message) |
| hash | |
|---|---|
| Developers | Variousopen-source andcommercial developers |
| Operating system | Unix,Unix-like,IBM i |
| Type | Command |
hash is acommand onUnix andUnix-likeoperating systems that prints the location information for the commands found. Thehash command has also been ported to theIBM i operating system.[1]
$ hash [name]
When the user gives a command, the shell searches for the command in the path specified in thePATH environmental variable and stores the location in the hash. This command can be used to search for the command given. The command is built into the shell.C shell implements this command in a different way.
The following options are supported.
This command returns the following exit values:
$ hash
Print the hash table.
$ hash cat
Searches for command cat in the path specified by PATH environmental variable; if found, adds it to the hash.
hash – Shell and Utilities Reference,The Single UNIX Specification, Version 5 fromThe Open Grouphash(1) – Solaris 11.4 User Commands ReferenceManual