Hash (Unix)
Encyclopedia
hash is a Unix
command that prints the location information for the commands found.
implements this command in a different way.
name Searches the PATH environmental variable for the name given
0 Successful completion
1 An Error occurred
Print the hash table.
2. hash cat
Searches for command cat in the path specified by PATH environmental variable; if found, adds it to the hash.
command, find
command, ksh
command, sh
command.
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
command that prints the location information for the commands found.
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 shellC shell
The C shell is a Unix shell that was created by Bill Joy while a graduate student at University of California, Berkeley in the late 1970s. It has been distributed widely, beginning with the 2BSD release of the BSD Unix system that Joy began distributing in 1978...
implements this command in a different way.
Options
The following options are supportedname 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
1. hashPrint the hash table.
2. hash cat
Searches for command cat in the path specified by PATH environmental variable; if found, adds it to the hash.
See also
The bash command, cshC shell
The C shell is a Unix shell that was created by Bill Joy while a graduate student at University of California, Berkeley in the late 1970s. It has been distributed widely, beginning with the 2BSD release of the BSD Unix system that Joy began distributing in 1978...
command, find
Find
In Unix-like and some other operating systems, find is a command-line utility that searches through one or more directory trees of a file system, locates files based on some user-specified criteria and applies a user-specified action on each matched file...
command, ksh
Korn shell
The Korn shell is a Unix shell which was developed by David Korn in the early 1980s and announced at USENIX on July 14, 1983. Other early contributors were AT&T Bell Labs developers Mike Veach, who wrote the emacs code, and Pat Sullivan, who wrote the vi code...
command, sh
Bourne shell
The Bourne shell, or sh, was the default Unix shell of Unix Version 7 and most Unix-like systems continue to have /bin/sh - which will be the Bourne shell, or a symbolic link or hard link to a compatible shell - even when more modern shells are used by most users.Developed by Stephen Bourne at AT&T...
command.