hash - Remember or report utility locations

hash [ -p filename ] [ utility ... ]

hash -r

Description

The hash utility adds utility to the list of remembered utility locations or removes all remembered utilities from the list. By default, hash uses a path search to find utility.

When no arguments are specified, hash reports the contents of the list. An entry that has not been looked at since the last cd command is marked with an asterisk; it is possible for the entry to be invalid.

Options

-p filename
Do not use a path search to find utility. Use the specified filename as the location of utility.
-r
Remove all previously remembered utility locations.

Operands

Each utility is added to the list of remembered utility locations.

Exit status

  • 0 when successful.