{"id":10327,"date":"2020-09-29T10:52:03","date_gmt":"2020-09-29T10:52:03","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=10327"},"modified":"2020-09-29T10:52:03","modified_gmt":"2020-09-29T10:52:03","slug":"reviewing-bash-history","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/","title":{"rendered":"What is Bash History? How to Review It?"},"content":{"rendered":"<p>While working in a Linux command-line interface (CLI), you might have wondered exactly what commands you executed during your workflow. Thankfully, you can find the commands you used in a bash history file that stores list of all commands a given user has entered into the system. When you review this list, you can troubleshoot input errors or mistakes done while performing command-line operations. In this article, you will learn about reviewing bash histories and the importance of the information contained within.<\/p>\n<h3>What is Bash History?<\/h3>\n<p>The history of commands issued in bash is known as bash history. Bash is a short-form for <strong>\u201cBourne Again Shell\u201d<\/strong>, a type of user-interface or shell with which users can directly interact with computer operating systems. This shell was developed for Unix systems and is still in use today on most advanced Linux operating systems. A bash command is a command run in bash. The bash history stores each of these commands that can be reviewed in a list format with the help of a simple Linux command.<\/p>\n<h3>Ways to Review Bash History<\/h3>\n<p>You can review your bash history using the following command:<\/p>\n<pre class=\"lang:default decode:true \">history<\/pre>\n<p>With this command you will get a numbered list of all past commands entered into the system, in sequential order.<\/p>\n<p>You can expand the amount of commands stored in the bash history, by modifying the <strong>.bashrc<\/strong> file. This file displays the operating style of a given user\u2019s bash profile, including the way its bash history is stored. In this file, bash history is stored depending on two parameters.<\/p>\n<p>The first parameter is:<\/p>\n<pre class=\"lang:default decode:true \">HISTFILESIZE<\/pre>\n<p>It dictates the total number of commands stored in the history file.<\/p>\n<p>The second parameter is:<\/p>\n<pre class=\"lang:default decode:true \">HISTSIZE<\/pre>\n<p>It dictates the number of commands stored in a given session. When you increase these values in the <strong>.bashrc\u00a0<\/strong>file, the number of commands stored in the bash history can be increased too.<\/p>\n<p>After having a list of previously-issued commands, they can be called using the number assigned in the history. For example, if you want to rerun the command listed in the history as entry 20, you can call that command as follows:<\/p>\n<pre class=\"lang:default decode:true \">!20<\/pre>\n<p>With this, the command that is associated with the 20th entry on the bash history list will run. Users can simplify the repetitive command-line operations.<\/p>\n<p>The bash history is by default stored at the end of a bash session. During the multiple concurrent sessions, the bash histories may lead to overwriting each other and so only the last connected session will be saved in the history. To resolve this issue, set the bash histories to append, rather than overwrite with the following command:<\/p>\n<pre class=\"lang:default decode:true \">shopt -s histappend<\/pre>\n<p>When you do it correctly, bash histories should be appended to the file for all sessions, even during the concurrent bash sessions.<\/p>\n<p>For clearing the bash history for security reasons, use the following command:<\/p>\n<pre class=\"lang:default decode:true \">history -c<\/pre>\n<p>With this, all commands from your bash history will get cleared permanently. Remember you can\u2019t recover the deleted histories.<\/p>\n<p>From the above examples, it is clear that you can review bash histories with a handful of simple commands. Due to these characteristics, bash histories have become a vital part of any Linux workflow or troubleshooting operations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While working in a Linux command-line interface (CLI), you might have wondered exactly what commands you executed during your workflow. Thankfully, you can find the commands you used in a bash history file that stores list of all commands a given user has entered into the system. When you review this list, you can troubleshoot [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[1645,1644,647,1646,1647],"class_list":["post-10327","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-howtos","tag-bash","tag-bash-history","tag-linux","tag-linux-os","tag-review-bash-history"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is Bash History? How to Review It?<\/title>\n<meta name=\"description\" content=\"Bash history stores all the commands used during the operations on Linux. The article represents ways to review the bash history.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Bash History? How to Review It?\" \/>\n<meta property=\"og:description\" content=\"Bash history stores all the commands used during the operations on Linux. The article represents ways to review the bash history.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-29T10:52:03+00:00\" \/>\n<meta name=\"author\" content=\"Pallavi Godse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pallavi Godse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/\"},\"author\":{\"name\":\"Pallavi Godse\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"headline\":\"What is Bash History? How to Review It?\",\"datePublished\":\"2020-09-29T10:52:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/\"},\"wordCount\":533,\"commentCount\":0,\"keywords\":[\"bash\",\"bash history\",\"Linux\",\"Linux OS\",\"review bash history\"],\"articleSection\":[\"How-Tos\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/\",\"name\":\"What is Bash History? How to Review It?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2020-09-29T10:52:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"description\":\"Bash history stores all the commands used during the operations on Linux. The article represents ways to review the bash history.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is Bash History? How to Review It?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\",\"name\":\"Pallavi Godse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"caption\":\"Pallavi Godse\"},\"description\":\"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Bash History? How to Review It?","description":"Bash history stores all the commands used during the operations on Linux. The article represents ways to review the bash history.","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:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/","og_locale":"en_US","og_type":"article","og_title":"What is Bash History? How to Review It?","og_description":"Bash history stores all the commands used during the operations on Linux. The article represents ways to review the bash history.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2020-09-29T10:52:03+00:00","author":"Pallavi Godse","twitter_misc":{"Written by":"Pallavi Godse","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/"},"author":{"name":"Pallavi Godse","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"headline":"What is Bash History? How to Review It?","datePublished":"2020-09-29T10:52:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/"},"wordCount":533,"commentCount":0,"keywords":["bash","bash history","Linux","Linux OS","review bash history"],"articleSection":["How-Tos"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/","name":"What is Bash History? How to Review It?","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2020-09-29T10:52:03+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"description":"Bash history stores all the commands used during the operations on Linux. The article represents ways to review the bash history.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/reviewing-bash-history\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"What is Bash History? How to Review It?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945","name":"Pallavi Godse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","caption":"Pallavi Godse"},"description":"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/10327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=10327"}],"version-history":[{"count":2,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/10327\/revisions"}],"predecessor-version":[{"id":10329,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/10327\/revisions\/10329"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=10327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=10327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=10327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}