hash (Unix)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
hash
DevelopersVarious open-source and commercial developers
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    Operating systemUnix, Unix-like, IBM i
    TypeCommand

    hash is a command on Unix and Unix-like operating systems that prints the location information for the commands found. The hash command has also been ported to the IBM i operating system.[1]

    Syntax

    [edit | edit source]
    $ hash [name]
    

    Description

    [edit | edit source]

    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

    [edit | edit source]

    The following options are supported.

    name
    Searches the PATH environmental variable for the name given

    Exit Status

    [edit | edit source]

    This command returns the following exit values:

    0
    Successful completion
    1
    An Error occurred

    Examples

    [edit | edit source]
    $ 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.

    See also

    [edit | edit source]

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    [edit | edit source]