builtin
Bash hash
Manage remembered executable paths. -t reports an entry and -r clears the table.
Formal Syntax & Structure
bash syntaxbash
hash [-r] [-p pathname] [-dt] [name ...]Return Value
exit status
Manage remembered executable paths. -t reports an entry and -r clears the table.
Working Example
Example Snippetbash
hash catpath=$(hash -t cat)[[ -x $path ]] && printf 'cached executable\n'hash -rif hash -t cat 2>/dev/null; then printf 'unexpected\n'; else printf 'cache cleared\n'; fi