Jump to content

hash (Unix)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GurchBot (talk | contribs) at 13:27, 19 July 2006 (Spelling: occured). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


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

Syntax

ksh: hash [name]

Description

When the user gives an command, the shell searchs for the command in the path specified in the PATH environental variable and stores the location in the hash. This command can be used to search for the command given. The command is build-in to the shell. csh shell implements this command in the different way.

Options

The following options are supported

name Searchs the PATH environmental varible for the name given

Exit Status

This command returns the following exit values:

0 Successful completion

1 An Error occurred

Examples

1. hash

Print the hash table.

2. hash cat

Searchs for command cat in the path specified by PATH environmental variable, if found addes it to the hash.

File

/usr/bin/hash contains the hash command.

See also

The bash command, csh command, find command, ksh command, sh command.