Jump to content

hash (Unix)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Rajesh tamil india (talk | contribs) at 12:05, 27 June 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)


hash is a Unix command that print the location information for the command executed.

Syntax

hash [-r] [name]

Description

The hash command in ksh gives the location information obtained by the shell by searching the PATH environmental variable

Options

The following options are supported

-r Print the hash table of the shell
name Print the location of the given name

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 -r Removes all the hash values 3. hash cat Prints the location information of the cat command.

File

/usr/bin/hash contains the hash command.

See also

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