{"id":5935,"date":"2014-02-03T11:12:24","date_gmt":"2014-02-03T16:12:24","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=5935"},"modified":"2014-02-03T11:12:24","modified_gmt":"2014-02-03T16:12:24","slug":"use-hash-tags-to-organize-bash-history","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/","title":{"rendered":"Use hash tags to organize bash history"},"content":{"rendered":"<p>From <a href=\"http:\/\/vignesh.foamsnet.com\/2013\/06\/using-hash-tags-to-organize-bash-history.html\" target=\"_blank\" rel=\"noopener noreferrer\">vignesh.foamsnet.com<\/a><\/p>\n<p>&#8220;We use hash tags all over the place in social networks. We use it extensively on Twitter and Instagram. Facebook recently launched support for hash tags as well.<\/p>\n<p>So, in a way, our online life revolves around hash tags. Given that, it\u2019s a really great thing for bash power users that # in shell means comment. I usually tend to type long commands and won\u2019t bother remembering or saving them somewhere as it is in the bash history and i can retrieve it by reverse-i-search (Ctrl+R) anytime I want. <\/p>\n<p>As time passes by, more than often I end up retyping the whole command as reverse-i-search doesn\u2019t have a unique combination of letters\/words to search for. So, off late, I have found a dead simple way to never lose control over reverse-i-search because of too many similar commands. I just append a hash tag every command I type in. And later search for the hash tag in reverse-i-search. Since, anything that follows # is treated as a comment, the text is silently ignored, while giving you power to search through it alter on.<\/p>\n<p>For example, when i write PHP code, I often tend to run lint on all the php files before executing them to make sure there aren\u2019t any silly syntax errors. This is the exact command that i run:<\/p>\n<p><code>find . -iname '*.php' -print0 | xargs -0 -n1 php -l<\/code><\/p>\n<p>If you look at this command, none if its contents are unique by any mean. All these phrases and commands are something that we use over and over again. So it\u2019s very plausible that this might get lost in the bash history and practically un-searchable with reverse-i-search. Now this is the command with a hash tag appended:<\/p>\n<p><code>find . -iname '*.php' -print0 | xargs -0 -n1 php -l #phplint<\/code><\/p>\n<p>Tada, there we go. From now on, we can do a reverse-i-search for \u201c#phplint\u201d or merely \u201cphplint\u201d to get back this command from the bash history. Also make sure you set HISTSIZE to a large value in your .bashrc to make sure you history is practically infinite.&#8221;<\/p>\n<p>From <a href=\"http:\/\/vignesh.foamsnet.com\/2013\/06\/using-hash-tags-to-organize-bash-history.html\" target=\"_blank\" rel=\"noopener noreferrer\">vignesh.foamsnet.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>From vignesh.foamsnet.com &#8220;We use hash tags all over the place in social networks. We use it extensively on Twitter and Instagram. Facebook recently launched support for hash tags as well. So, in a way, our online life revolves around hash tags. Given that, it\u2019s a really great thing for bash power users that # in&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-5935","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Use hash tags to organize bash history - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Use hash tags to organize bash history - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"From vignesh.foamsnet.com &#8220;We use hash tags all over the place in social networks. We use it extensively on Twitter and Instagram. Facebook recently launched support for hash tags as well. So, in a way, our online life revolves around hash tags. Given that, it\u2019s a really great thing for bash power users that # in... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2014-02-03T16:12:24+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/use-hash-tags-to-organize-bash-history\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/use-hash-tags-to-organize-bash-history\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Use hash tags to organize bash history\",\"datePublished\":\"2014-02-03T16:12:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/use-hash-tags-to-organize-bash-history\\\/\"},\"wordCount\":344,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/use-hash-tags-to-organize-bash-history\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/use-hash-tags-to-organize-bash-history\\\/\",\"name\":\"Use hash tags to organize bash history - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2014-02-03T16:12:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/use-hash-tags-to-organize-bash-history\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/use-hash-tags-to-organize-bash-history\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/use-hash-tags-to-organize-bash-history\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Use hash tags to organize bash history\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Use hash tags to organize bash history - Linux Shtuff","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:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/","og_locale":"en_US","og_type":"article","og_title":"Use hash tags to organize bash history - Linux Shtuff","og_description":"From vignesh.foamsnet.com &#8220;We use hash tags all over the place in social networks. We use it extensively on Twitter and Instagram. Facebook recently launched support for hash tags as well. So, in a way, our online life revolves around hash tags. Given that, it\u2019s a really great thing for bash power users that # in... Read More","og_url":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2014-02-03T16:12:24+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Use hash tags to organize bash history","datePublished":"2014-02-03T16:12:24+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/"},"wordCount":344,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/","url":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/","name":"Use hash tags to organize bash history - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2014-02-03T16:12:24+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/use-hash-tags-to-organize-bash-history\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Use hash tags to organize bash history"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/5935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=5935"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/5935\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=5935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=5935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=5935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}