hash (Unix)

hash is a Unix command that prints the location information for the commands found.

hash
Operating systemUnix and Unix-like
TypeCommand

Syntax

$ hash [name]

Description

When the user gives a command, the shell searches for the command in the path specified in the PATH 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.

Options

The following options are supported.

name
Searches the PATH environmental variable for the name given

Exit Status

This command returns the following exit values:

0
Successful completion
1
An Error occurred

Examples

$ 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.

gollark: DHMO causes huge amounts of property damage.
gollark: As well as a key component in acid rain.
gollark: And it's actually a greenhouse gas, too.
gollark: http://www.dhmo.org/images/drainpipe.jpgHere is a picture of DHMO-contaminated sewage.
gollark: Did you know that DHMO is found in large amounts in *all forms of cancer*?

See also

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.