A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/linux-unix/hash-command-in-linux-with-examples/ below:

hash command in Linux with examples

hash command in Linux with examples

Last Updated : 11 Jul, 2025

The `hash` is a command in Linux that helps in managing the hash table. It facilitates with mapping the names of executable files to their locations on disk. It helps in speeds uping the commands execution by remembering paths of frequently used commands. It uses the `hash` to view hashed commands (`hash -l`), clear specific entries (`hash -d command`), or reset the entire hash table (`hash -r`). In this article, we will discuss on what is hash command, its syntax, options with examples, best practices and trouble shooting of hash command issues much more.

What is Hash Command?

The hash command in Linux system is the built-in command of bash which is used to maintain a hash table of recently executed programs. It remembers and shows the program locations. It will give the full pathname of each command name. It helps in automatic updates, that are executed on their locations change, ensuring efficient command resolution in the linux environment.

Syntax
hash [-lr] [-p pathname] [-dt] [name ...]
Options of Hash Command

The following are the options of hash command describing with its functionalities:

Option Functionality hash It displays the current contents of the hash table. hash -r It will resets the entire hash table, forgetting all remembered locations of commands. hash -d name It is used to deletes the specified command name from the hash table. hash -l It helps in listing all the remembered commands and their paths stored in the hash table. Examples of Hash Command

The following are the examples of hash command:

Example - 1

hash

Example-2

The following is the hash command with -r option :

hash -r 

Example - 3

hash -l
Features of Hash Command

The following are the features of hash command:

The following are the some of the troube shooting issues related to hash command:

Best Practices of Using Hash Command

The following are the best practices of using hash Command:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4