hash
shell builtinLinux/Unix
The hash command is one of the most frequently used commands in Linux/Unix-like operating systems. hash Display or manipulate the bash command hash table
Quick Reference
Command Name:
hash
Category:
shell builtin
Platform:
Linux/Unix
Basic Usage:
hash [options] [arguments]
Common Use Cases
Syntax
hash [-lr] [-p pathname] [-dt] [name]
Options
Option | Description |
---|---|
-d |
Forget the remembered location of the specified name(s) |
-l |
Display in a format that can be reused as input |
-p pathname |
Use pathname as the full pathname for the specified name |
-r |
Forget all remembered locations |
-t |
Print the remembered path for each specified name |
Examples
How to Use These Examples
The examples below show common ways to use the hash
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
hash