hash — Bash command path cache
cheat sheet · Ubuntu 24.04; Bash 5.2 for shell builtins https://lab.dimsanych.ru/en/wiki/hash/Cheat sheet
-
type hashcheck the command kind -
help hashbuiltin help -
hashdisplay remembered paths -
hash -t lsshow cached ls path, if present -
hash -rclear this shell's table
Options
Without arguments, hash displays the table. -t prints the path for a
remembered name, -d removes one entry, and -r clears the table. Querying
an entry that has not been created can fail.
Manually binding a name to a path with -p changes command resolution and
requires separate understanding. Inspection and clearing are enough for
ordinary diagnostics. Use help hash for the current shell's documentation.