hash (Unix)
hash is a Unix command that prints the location information for the commands found.
Operating system | Unix and Unix-like |
---|---|
Type | Command |
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: Esobot is stuck infinitely recursing.
gollark: Hmm, we should make that.
gollark: Those people are just stuck in the past, and don't want to welcome the glorious future where every webpage downloads 50MB of JavaScript and uses 2GB of RAM to write "Hello World" and make it blink, and has half the screen just be advertising.
gollark: REAL programmers don't use CSS but instead just draw everything to a canvas.
gollark: I think it is interpreŧed.
External links
![]() |
The Wikibook Guide to Unix has a page on the topic of: Commands |
- – Commands & Utilities Reference, The Single UNIX Specification, Issue 7 from The Open Group
- – Solaris 10 User Commands Reference Manual
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.