{"id":13754,"date":"2023-07-11T03:55:21","date_gmt":"2023-07-11T03:55:21","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=13754"},"modified":"2024-05-06T08:46:29","modified_gmt":"2024-05-06T08:46:29","slug":"hash-command-in-linux","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/hash-command-in-linux\/","title":{"rendered":"The \u201chash\u201d Command in Linux [6 Practical Examples]"},"content":{"rendered":"<p style=\"text-align: justify;\"><strong>Bash <\/strong>is a popular <strong>built-in shell<\/strong> in the <strong>Unix-like <\/strong>operating system. And hash is the <strong>built-in command <\/strong>within the shell that maintains the bash path hash which is actually a <strong>hash table<\/strong>.\u00a0 By running a hash command, one can force the hash table to execute all the commands in subsequent invocations rather than the entire system\u2019s directory search. In this guide, I will demonstrate the functionalities of the hash command on Linux within a hash table.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Key_Takeaways\" >Key Takeaways<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Applications\" >Applications<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#What_is_%E2%80%9Chash%E2%80%9D_in_Bash\" >What is &#8220;hash&#8221; in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Why_Bash_the_%E2%80%9Chash%E2%80%9D_Command\" >Why Bash the &#8220;hash&#8221; Command?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Exit_Status\" >Exit Status<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Practical_Examples_of_%E2%80%9Chash%E2%80%9D_command_in_Linux\" >Practical Examples of \u201chash\u201d command in Linux<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Example_1_Displaying_the_Hash_Table_Using_the_%E2%80%9Chash%E2%80%9D_Command\" >Example 1: Displaying the Hash Table Using the \u201chash\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Example_2_Listing_the_contents_of_the_Hash_Table_Using_the_%E2%80%9Chash%E2%80%9D_Command\" >Example 2: Listing the contents of the Hash Table Using the \u201chash\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Example_3_Showing_the_Location_of_Commands_Using_the_%E2%80%9Chash%E2%80%9D_Command\" >Example 3: Showing the Location of Commands Using the \u201chash\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Example_4_Adding_Naming_Command_Path_Using_the_%E2%80%9Chash%E2%80%9D_Command\" >Example 4: Adding &amp; Naming Command Path Using the \u201chash\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Example_5_Deleting_Items_From_Hash_Table_Using_the_%E2%80%9Chash%E2%80%9D_Command\" >Example 5: Deleting Items From Hash Table Using the \u201chash\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Example_6_Clearing_the_Hash_Table_Using_the_%E2%80%9Chash%E2%80%9D_Command\" >Example 6: Clearing the Hash Table Using the \u201chash\u201d Command<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#People_Also_Ask\" >People Also Ask<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Key_Takeaways\"><\/span>Key Takeaways<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>Learning about the hash command in Bash.<\/li>\n<li>Learning about the <strong>syntax <\/strong>and <strong>return values<\/strong> of hash commands.<\/li>\n<li>Getting ideas about various <strong>executions <\/strong>on a <strong>hash table<\/strong>.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Applications\"><\/span>Applications<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>For viewing <strong>hash table<\/strong> <strong>entries <\/strong>and <strong>command lookup<\/strong>.<\/li>\n<li>For refreshing the hash table to make the shell understand the changes.<\/li>\n<li>For forcing the shell to look for a command in the path.<\/li>\n<li>For clearing the hash table.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"What_is_%E2%80%9Chash%E2%80%9D_in_Bash\"><\/span>What is &#8220;hash&#8221; in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>Hash <\/strong>is a <strong>built-in command<\/strong> in the <strong>Bash shell<\/strong>. It plays a significant role in managing the <strong>hash table<\/strong> and boosting the command execution speed. The hash command displays the contents of the hash table, records the commands path, and reveals the cached commands\u2019 path avoiding the full directory search.<\/p>\n<p>The basic syntax for the <strong>hash <\/strong>command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash [option] [command]\u00a0<\/code><\/pre>\n<p><span style=\"color: #800080;\"><strong>Useful Options <\/strong><\/span><\/p>\n<p>There are several options that can be used in <strong>hash syntax<\/strong>. They are:<\/p>\n<div class=\"su-list\" style=\"margin-left:8px\">\n<ul>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>l<\/strong> (List): Displays a list of information that can be reused as input for another program.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>r <\/strong>(Reset): Removes all entries and clears the hash table.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>p <\/strong>(Pathname): Allows adding or modifying entries in the hash table with a full pathname.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>t <\/strong>(Type): Displays the location of the specific commands.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>d <\/strong>(Delete): Removes the remembered locations of each command in the hash table.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>command<\/strong>: It is an optional argument to limit the options only to the mentioned ones.<\/li>\n<\/ul>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Why_Bash_the_%E2%80%9Chash%E2%80%9D_Command\"><\/span>Why Bash the &#8220;hash&#8221; Command?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The hash command accelerates the command execution within the bash shell. Here is why you should use bash the <strong>hash command<\/strong>:<\/p>\n<div class=\"su-list\" style=\"margin-left:8px\">\n<ul>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> To speed up command execution.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> To reduce disk I\/O operations.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> To display the command path.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> To manage the hash table.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> To improve user experience.<\/li>\n<\/ul>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Exit_Status\"><\/span>Exit Status<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The <strong>return values<\/strong> of hash commands are usually checked only when you are using them in a script. Here are the return values of the hash:<\/p>\n<div class=\"su-table su-table-responsive su-table-alternate su-table-fixed\">\n<table style=\"width: 100%\" width=\"100%\">\n<tbody>\n<tr>\n<th width=\"301\"><strong>Value <\/strong><\/th>\n<th width=\"301\"><strong>Description<\/strong><\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: center;vertical-align: middle\" width=\"301\">0<\/td>\n<td style=\"text-align: center;vertical-align: middle\" width=\"301\">Successful execution<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;vertical-align: middle\" width=\"301\">Otherwise<\/td>\n<td style=\"text-align: center;vertical-align: middle\" width=\"301\">Command not found, an error occurred<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You can access the return values provided by the hash command through \u2018<strong>$?<\/strong>\u2019, a <strong>special shell variable<\/strong> just after execution like the following:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash &lt;command&gt;\necho $?<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>hash &lt;command&gt;<\/strong>: Execute the hash command with your desired command.<\/li>\n<li><a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/output\/echo-command\/\" target=\"_blank\" rel=\"noopener\"><strong>echo<\/strong><\/a>: Display the value of $?.<\/li>\n<li><strong>$?<\/strong>: Holds the exit status of the most recent command. Here, the recently used command is the \u2018hash\u2019 command.<\/li>\n<\/ul>\n<\/div><\/div><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-13780\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img1-checking-return-values.png\" alt=\"Checking return values of hash commands\" width=\"534\" height=\"198\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img1-checking-return-values.png 534w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img1-checking-return-values-300x111.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img1-checking-return-values-766x284.png 766w\" sizes=\"(max-width: 534px) 100vw, 534px\" \/>The above image represents the execution of the hash command with a special shell variable for accessing return values.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Practical_Examples_of_%E2%80%9Chash%E2%80%9D_command_in_Linux\"><\/span>Practical Examples of \u201chash\u201d command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Hash tables have versatile implementations. You can display, list up, add, delete contents, and more within the hash table. Below I am going to share some execution of the hash table in Linux:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_1_Displaying_the_Hash_Table_Using_the_%E2%80%9Chash%E2%80%9D_Command\"><\/span>Example 1: Displaying the Hash Table Using the \u201chash\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you want to display the hash table, follow the steps below accordingly:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u2776 At First, open your <strong>Ubuntu <\/strong>terminal.<\/p>\n<p>\u2777 Write the following command to show the hash table:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>hash<\/strong>: The hash command without any argument displays the lists of commands in the hash table with their full pathname.<\/li>\n<\/ul>\n<\/div><\/div>\n<p>You will see an output like the following image:<img decoding=\"async\" class=\"aligncenter wp-image-13781 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img2-Displaying-the-contents-of-hash-table.png\" alt=\"Displaying all the contents of hash table in linux\" width=\"700\" height=\"323\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img2-Displaying-the-contents-of-hash-table.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img2-Displaying-the-contents-of-hash-table-300x138.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img2-Displaying-the-contents-of-hash-table-767x354.png 767w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\"><strong>Note:<\/strong> If a new session is opened, there will be no hash table and no command will be executed and you will see an output like the below:<\/p>\n<\/div><\/div><img decoding=\"async\" class=\"aligncenter size-full wp-image-13782\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img3-hash-table-empty.png\" alt=\"Displaying the empty hash table\" width=\"700\" height=\"162\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img3-hash-table-empty.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img3-hash-table-empty-300x69.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img3-hash-table-empty-765x177.png 765w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The image shows that the hash table is empty.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_2_Listing_the_contents_of_the_Hash_Table_Using_the_%E2%80%9Chash%E2%80%9D_Command\"><\/span>Example 2: Listing the contents of the Hash Table Using the \u201chash\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Use the following command in the terminal to display the list of currently hashed commands that can be used as input for another program:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash -l<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>hash -l<\/strong>: Displays the lists of commands in the hash table.<\/li>\n<\/ul>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13783 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img4-listing-hash-table.png\" alt=\"Listing the contents of hash table in linux\" width=\"825\" height=\"297\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img4-listing-hash-table.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img4-listing-hash-table-300x108.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img4-listing-hash-table-767x276.png 767w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>You can see the list of the hash table in the above image.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_3_Showing_the_Location_of_Commands_Using_the_%E2%80%9Chash%E2%80%9D_Command\"><\/span>Example 3: Showing the Location of Commands Using the \u201chash\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To display the location of a command hashed currently, <span style=\"font-weight: 400;\">open your <\/span><strong>Ubuntu terminal<\/strong><span style=\"font-weight: 400;\"> &amp; write<\/span>\u00a0the command below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash -t chmod<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>hash -t<\/strong>: Displays the location of the currently hashed command.<\/li>\n<li><a href=\"https:\/\/linuxsimply.com\/chmod-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>chmod<\/strong><\/a>: The command for which you want to display the full location. Here, I have used the command <strong>\u2018chmod\u2019<\/strong>.<\/li>\n<\/ul>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13784\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img5-location-of-command.png\" alt=\"Showing the location of a command\" width=\"700\" height=\"178\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img5-location-of-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img5-location-of-command-300x76.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img5-location-of-command-767x195.png 767w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>To display the location of <strong>multiple commands<\/strong> write the following command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash -t chmod nano<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>chmod <\/strong><a href=\"https:\/\/linuxsimply.com\/nano-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>nano<\/strong><\/a>: Separate the commands by the spaces you want to list up. Here, I have listed up two commands <strong>\u2018chmod\u2019 <\/strong>and <strong>\u2018nano\u2019<\/strong>.<\/li>\n<\/ul>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13785\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img6-location-of-multiple-commands.png\" alt=\"Showing the location of multiple commands\" width=\"700\" height=\"221\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img6-location-of-multiple-commands.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img6-location-of-multiple-commands-300x95.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img6-location-of-multiple-commands-767x242.png 767w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>From the image, you can see the locations of two commands <strong>\u2018chmod\u2019<\/strong> and <strong>\u2018nano\u2019<\/strong>.<\/p>\n<hr \/>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/alias-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201calias\u201d Command in Linux [3 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/unalias-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cunalias\u201d Command in Linux [3 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/exit-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cexit\u201d Command in Linux [5 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Example_4_Adding_Naming_Command_Path_Using_the_%E2%80%9Chash%E2%80%9D_Command\"><\/span>Example 4: Adding &amp; Naming Command Path Using the \u201chash\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Use the command <strong>option \u2018-p\u2019 <\/strong>to add a command to the hash table. For that, write the following command on your command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash -p \/home\/hash.sh bash<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>hash -p<\/strong>: Adds or modifies new entries with a specific pathname.<\/li>\n<li><strong>\/home\/hash.sh bash<\/strong>: Specific path for the added content in the hash table with a name. Here, I have added <strong>\u2018\/home\/hash.sh\u2019<\/strong> script in the hash table and named it <strong>\u2018bash\u2019<\/strong>.<\/li>\n<\/ul>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13787\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img7-adding-naming-new-path.png\" alt=\"Adding &amp; naming new command path in hash table\" width=\"825\" height=\"388\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img7-adding-naming-new-path.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img7-adding-naming-new-path-300x141.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img7-adding-naming-new-path-768x361.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>By running the <strong>\u2018hash -l\u2019 <\/strong>command you can check if the new item has been added or not like in the snapshot above.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_5_Deleting_Items_From_Hash_Table_Using_the_%E2%80%9Chash%E2%80%9D_Command\"><\/span>Example 5: Deleting Items From Hash Table Using the \u201chash\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To delete an item from the hash table, write the following command in the terminal:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash -d command<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>hash -d<\/strong>: Deletes a hashed item from the hash table.<\/li>\n<li><strong>command<\/strong>: The item you want to remove from the hash table. Here, I have deleted the item \u2018<strong>\/usr\/bin\/clear<\/strong>\u2019.<\/li>\n<\/ul>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13788\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img8-delete-an-item.png\" alt=\"Deleting an item from hash table\" width=\"825\" height=\"335\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img8-delete-an-item.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img8-delete-an-item-300x122.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img8-delete-an-item-766x311.png 766w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>Subsequently, run \u2018<strong>hash -l<\/strong>\u2019 to see the current list of items in the hash table. And from the above image you can see that after executing the <strong>delete operation<\/strong> on the \u2018<strong>\/usr\/bin\/clear<\/strong>\u2019 item, it is no longer in the list of recently hashed commands.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_6_Clearing_the_Hash_Table_Using_the_%E2%80%9Chash%E2%80%9D_Command\"><\/span>Example 6: Clearing the Hash Table Using the \u201chash\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>After checking all items in the hash table, you can fully clear the hash table by running the command below in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">hash -r<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>hash -r<\/strong>: Removes all items and clears the hash table.<\/li>\n<\/ul>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13789\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img9-clear-hash-table.png\" alt=\"Clearing the hash table\" width=\"700\" height=\"465\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img9-clear-hash-table.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img9-clear-hash-table-300x199.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/img9-clear-hash-table-768x510.png 768w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>Check if the hash table has successfully been removed or not by running the command <strong>\u2018hash\u2019<\/strong> once again. If it is done properly, you will see the output message <strong>\u2018hash: hash table empty\u2019 <\/strong>like the above image.<\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Wrapping up the whole guide you will get the key points of the \u2018<strong>hash<\/strong>\u2019 command in Linux that helps optimize the track of executed commands and boost up the speed and response time.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><div class=\"su-accordion su-u-trim\">\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>Can I run \u2018hash\u2019 command without any options?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">Yes, you can run the <strong>\u2018hash\u2019<\/strong> command without any options to display the hash table.<\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>How can I set a command\u2019s path manually in bash hash table?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">Run \u2018<strong>hash -p \/path\/to\/command command<\/strong>\u2019 to manually set a command\u2019s path in bash hash table.<\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>How to delete multiple items from a hash table at a time?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">Run \u2018<strong>hash -d command1 command2 \u2026<\/strong>\u2019 to delete multiple items from a hash table at a time. Insert all the commands after the \u2018<strong>-d<\/strong>\u2019 option parted by spaces.<\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>Can \u2018hash\u2019 command return values other than 0 or 1?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">No, the hash command return only <strong>\u20180\u2019<\/strong> or <strong>\u20181\u2019<\/strong> as the exit status of the script.<\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>Does \u2018hash\u2019 command alter the exit status of a bash script?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">No, the hash command doesn\u2019t alter the exit status of a bash script directly.<\/div><\/div>\n<p style=\"text-align: justify;\"><\/div>\n<hr \/>\n<p><strong><span style=\"color: #000080; font-size: 18pt;\">Related Articles<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cbash\u201d Command in Linux [5 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/clear-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cclear\u201d Command in Linux [3 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/declare-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cdeclare\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/export-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cexport\u201d Command in Linux [8 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/source-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201csource\u201d Command in Linux [3 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/echo-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cecho\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/read-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cread\u201d Command in Linux [8 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/set-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cset\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/unset-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cunset\u201d Command in Linux [2 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/eval-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201ceval\u201d Command in Linux [4 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;13754&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;The \u201chash\u201d Command in Linux [6 Practical Examples]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bash is a popular built-in shell in the Unix-like operating system. And hash is the built-in command within the shell &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"The \u201chash\u201d Command in Linux [6 Practical Examples]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/#more-13754\" aria-label=\"Read more about The \u201chash\u201d Command in Linux [6 Practical Examples]\">Read more<\/a><\/p>\n","protected":false},"author":314905,"featured_media":13806,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[57],"class_list":["post-13754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands","tag-shell-built-in-commands","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The \u201chash\u201d Command in Linux [6 Practical Examples]<\/title>\n<meta name=\"description\" content=\"Append the built-in &#039;hash&#039; command in Linux, manage the hash table and optimize the command look-up efficiency.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The \u201chash\u201d Command in Linux [6 Practical Examples]\" \/>\n<meta property=\"og:description\" content=\"Append the built-in &#039;hash&#039; command in Linux, manage the hash table and optimize the command look-up efficiency.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/hash-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-11T03:55:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-06T08:46:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/Feature-image-hash-command-in-linux.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nadiba Rahman\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nadiba Rahman\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/\"},\"author\":{\"name\":\"Nadiba Rahman\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/69b717a03a5d9dc48e683aaffe22d33f\"},\"headline\":\"The \u201chash\u201d Command in Linux [6 Practical Examples]\",\"datePublished\":\"2023-07-11T03:55:21+00:00\",\"dateModified\":\"2024-05-06T08:46:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/\"},\"wordCount\":1526,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Feature-image-hash-command-in-linux.png\",\"keywords\":[\"shell built-in commands\"],\"articleSection\":[\"Linux Commands\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/\",\"name\":\"The \u201chash\u201d Command in Linux [6 Practical Examples]\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Feature-image-hash-command-in-linux.png\",\"datePublished\":\"2023-07-11T03:55:21+00:00\",\"dateModified\":\"2024-05-06T08:46:29+00:00\",\"description\":\"Append the built-in 'hash' command in Linux, manage the hash table and optimize the command look-up efficiency.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Feature-image-hash-command-in-linux.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Feature-image-hash-command-in-linux.png\",\"width\":400,\"height\":400,\"caption\":\"Feature image-the 'hash' command in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/hash-command-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The \u201chash\u201d Command in Linux [6 Practical Examples]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/69b717a03a5d9dc48e683aaffe22d33f\",\"name\":\"Nadiba Rahman\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"caption\":\"Nadiba Rahman\"},\"description\":\"Hello, This is Nadiba Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation with a bachelor\u2019s degree in Electronics &amp; Telecommunication Engineering from Rajshahi University of Engineering &amp; Technology (RUET).I am quite passionate about crafting. I really adore exploring and learning new things which always helps me to think transparently. And this curiosity led me to pursue knowledge about Linux. My goal is to portray Linux-based practical problems and share them with you. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/nadiba.rahman?mibextid=ZbWKwL\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/nadiba-rahman-443459171\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/nadiba\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The \u201chash\u201d Command in Linux [6 Practical Examples]","description":"Append the built-in 'hash' command in Linux, manage the hash table and optimize the command look-up efficiency.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/linuxsimply.com\/hash-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"The \u201chash\u201d Command in Linux [6 Practical Examples]","og_description":"Append the built-in 'hash' command in Linux, manage the hash table and optimize the command look-up efficiency.","og_url":"https:\/\/linuxsimply.com\/hash-command-in-linux\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL","article_published_time":"2023-07-11T03:55:21+00:00","article_modified_time":"2024-05-06T08:46:29+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/Feature-image-hash-command-in-linux.png","type":"image\/png"}],"author":"Nadiba Rahman","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nadiba Rahman","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/"},"author":{"name":"Nadiba Rahman","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/69b717a03a5d9dc48e683aaffe22d33f"},"headline":"The \u201chash\u201d Command in Linux [6 Practical Examples]","datePublished":"2023-07-11T03:55:21+00:00","dateModified":"2024-05-06T08:46:29+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/"},"wordCount":1526,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/Feature-image-hash-command-in-linux.png","keywords":["shell built-in commands"],"articleSection":["Linux Commands"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/hash-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/","url":"https:\/\/linuxsimply.com\/hash-command-in-linux\/","name":"The \u201chash\u201d Command in Linux [6 Practical Examples]","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/Feature-image-hash-command-in-linux.png","datePublished":"2023-07-11T03:55:21+00:00","dateModified":"2024-05-06T08:46:29+00:00","description":"Append the built-in 'hash' command in Linux, manage the hash table and optimize the command look-up efficiency.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/hash-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/Feature-image-hash-command-in-linux.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/Feature-image-hash-command-in-linux.png","width":400,"height":400,"caption":"Feature image-the 'hash' command in Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/hash-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"The \u201chash\u201d Command in Linux [6 Practical Examples]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/69b717a03a5d9dc48e683aaffe22d33f","name":"Nadiba Rahman","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","caption":"Nadiba Rahman"},"description":"Hello, This is Nadiba Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation with a bachelor\u2019s degree in Electronics &amp; Telecommunication Engineering from Rajshahi University of Engineering &amp; Technology (RUET).I am quite passionate about crafting. I really adore exploring and learning new things which always helps me to think transparently. And this curiosity led me to pursue knowledge about Linux. My goal is to portray Linux-based practical problems and share them with you. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL","https:\/\/www.linkedin.com\/in\/nadiba-rahman-443459171"],"url":"https:\/\/linuxsimply.com\/author\/nadiba\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/13754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314905"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=13754"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/13754\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/13806"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=13754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=13754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=13754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}