{"id":16781,"date":"2012-10-02T15:48:51","date_gmt":"2012-10-02T13:48:51","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=16781"},"modified":"2012-10-02T15:48:51","modified_gmt":"2012-10-02T13:48:51","slug":"bash-directory-bookmarks","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/","title":{"rendered":"Bash directory bookmarks"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>While reading through the comments to <a href=\"http:\/\/habrahabr.ru\/post\/151484\/#habracut\">this Habrahabr article<\/a> (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. \u00a0Here&#8217;s how to set it up.<\/p>\n<p>Firstly, add the following lines to your <em>.bashrc<\/em> or <em>.bash_profile<\/em> file:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# Bash Directory Bookmarks\r\n# From: http:\/\/habrahabr.ru\/post\/151484\/#habracut\r\nalias m1='alias g1=&quot;cd `pwd`&quot;'\r\nalias m2='alias g2=&quot;cd `pwd`&quot;'\r\nalias m3='alias g3=&quot;cd `pwd`&quot;'\r\nalias m4='alias g4=&quot;cd `pwd`&quot;'\r\nalias m5='alias g5=&quot;cd `pwd`&quot;'\r\nalias m6='alias g6=&quot;cd `pwd`&quot;'\r\nalias m7='alias g7=&quot;cd `pwd`&quot;'\r\nalias m8='alias g8=&quot;cd `pwd`&quot;'\r\nalias m9='alias g9=&quot;cd `pwd`&quot;'\r\nalias mdump='alias|grep -e &quot;alias g&#x5B;0-9]&quot;|grep -v &quot;alias m&quot; &gt; ~\/.bookmarks'\r\nalias mload='source ~\/.bookmarks'\r\nalias ah='(echo;alias | grep &quot;g&#x5B;0-9]&quot; | grep -v &quot;m&#x5B;0-9]&quot; | cut -d&quot; &quot; -f &quot;2,3&quot;| sed &quot;s\/=\/ \/&quot; | sed &quot;s\/cd \/\/&quot;;echo)'\r\n<\/pre>\n<p>Secondly, if you are already using <em>~\/.bookmarks<\/em> file for anything, change the two references to it in the above lines to some other file. \u00a0It&#8217;s where your directory bookmarks will be stored.<\/p>\n<p>Thirdly, if you prefer to save the bookmarks between your bash sessions, add the &#8220;<strong>mload<\/strong>&#8221; command to the end of your <em>.bashrc<\/em> or <em>.bash_profile<\/em> file, and &#8220;<strong>mdump<\/strong>&#8221; to your <em>.bash_logout<\/em> file.<\/p>\n<p>Start a new bash shell and you are all set.<\/p>\n<p>Using this setup is extremely easy. \u00a0Navigate to the directory that you want to bookmark, and save it under the numbered bookmark:<\/p>\n<pre class=\"brush: bash; light: true; title: ; notranslate\" title=\"\">\r\n$ cd \/var\/www\/html\r\n$ m1\r\n<\/pre>\n<p>When you want to navigate back to that folder, simply call the numbered bookmarks:<\/p>\n<pre class=\"brush: bash; light: true; title: ; notranslate\" title=\"\">\r\n$ g1\r\n<\/pre>\n<p>If you need to refresh your memory, issue &#8220;<strong>ah<\/strong>&#8221; command (think: aliases help), and it will print out the list of your current numbered bookmarks with the directory paths associated with them.<\/p>\n<p>In case you need more than nine bookmarks, simply extend the lines in your <em>.bashrc<\/em> or <em>.bash_profile<\/em> file to run through more numbers, or use some other bookmark naming convention that works for you.<\/p>\n<p>Enjoy.<\/p>\n<p>P.S.: A quick Google search points to <a href=\"http:\/\/www.huyng.com\/posts\/quick-bash-tip-directory-bookmarks\/\">the author&#8217;s page<\/a>, which links to a more advanced solution &#8211; <a href=\"http:\/\/www.huyng.com\/projects\/bashmarks\/\">bashmarks<\/a>.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. \u00a0Here&#8217;s how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: # Bash Directory Bookmarks # From: http:\/\/habrahabr.ru\/post\/151484\/#habracut alias m1=&#8217;alias g1=&quot;cd `pwd`&quot;&#8217; alias m2=&#8217;alias g2=&quot;cd &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Bash directory bookmarks<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_links_to":"","_links_to_target":""},"categories":[1,6,18,133,62],"tags":[3098,550,1079],"keyring_services":[],"class_list":["post-16781","post","type-post","status-publish","format-standard","hentry","category-general","category-linux","category-programming","category-sysadmin","category-technology","tag-bash","tag-bookmarks","tag-productivity"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. Here&#039;s how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: [code lang=&quot;bash&quot;] # Bash Directory Bookmarks # From: http:\/\/habrahabr.ru\/post\/151484\/#habracut alias m1=&#039;alias g1=&quot;cd `pwd`&quot;&#039; alias\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Leonid Mamchenkov\"\/>\n\t<meta name=\"google-site-verification\" content=\"VHvdD0_usx1_4DzKy_QCVcICVgX2EgA2ybELT-wl7kQ\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Leonid Mamchenkov - Life, universe, and everything else\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Bash directory bookmarks - Leonid Mamchenkov\" \/>\n\t\t<meta property=\"og:description\" content=\"While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. Here&#039;s how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: [code lang=&quot;bash&quot;] # Bash Directory Bookmarks # From: http:\/\/habrahabr.ru\/post\/151484\/#habracut alias m1=&#039;alias g1=&quot;cd `pwd`&quot;&#039; alias\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2026\/03\/leonid-sailing-beer.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2026\/03\/leonid-sailing-beer.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2012-10-02T13:48:51+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2012-10-02T13:48:51+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/MamchenkovBlog\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@mamchenkov\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Bash directory bookmarks - Leonid Mamchenkov\" \/>\n\t\t<meta name=\"twitter:description\" content=\"While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. Here&#039;s how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: [code lang=&quot;bash&quot;] # Bash Directory Bookmarks # From: http:\/\/habrahabr.ru\/post\/151484\/#habracut alias m1=&#039;alias g1=&quot;cd `pwd`&quot;&#039; alias\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@mamchenkov\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2026\/03\/leonid-sailing-beer.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#blogposting\",\"name\":\"Bash directory bookmarks - Leonid Mamchenkov\",\"headline\":\"Bash directory bookmarks\",\"author\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/author\\\/leonid\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3cf6df002a284d78fb6e9d8222ca4d102e0832035ed6bc8447008bd234e131a4?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Leonid Mamchenkov\"},\"datePublished\":\"2012-10-02T15:48:51+02:00\",\"dateModified\":\"2012-10-02T15:48:51+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#webpage\"},\"articleSection\":\"All, Linux, Programming, Sysadmin, Technology, bash, bookmarks, productivity\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/category\\\/technology\\\/linux\\\/#listItem\",\"name\":\"Linux\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/category\\\/technology\\\/linux\\\/#listItem\",\"position\":3,\"name\":\"Linux\",\"item\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/category\\\/technology\\\/linux\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#listItem\",\"name\":\"Bash directory bookmarks\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#listItem\",\"position\":4,\"name\":\"Bash directory bookmarks\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/category\\\/technology\\\/linux\\\/#listItem\",\"name\":\"Linux\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/#person\",\"name\":\"Leonid Mamchenkov\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3cf6df002a284d78fb6e9d8222ca4d102e0832035ed6bc8447008bd234e131a4?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Leonid Mamchenkov\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/author\\\/leonid\\\/#author\",\"url\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/author\\\/leonid\\\/\",\"name\":\"Leonid Mamchenkov\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3cf6df002a284d78fb6e9d8222ca4d102e0832035ed6bc8447008bd234e131a4?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Leonid Mamchenkov\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#webpage\",\"url\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/\",\"name\":\"Bash directory bookmarks - Leonid Mamchenkov\",\"description\":\"While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. Here's how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: [code lang=\\\"bash\\\"] # Bash Directory Bookmarks # From: http:\\\/\\\/habrahabr.ru\\\/post\\\/151484\\\/#habracut alias m1='alias g1=\\\"cd `pwd`\\\"' alias\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/2012\\\/10\\\/02\\\/bash-directory-bookmarks\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/author\\\/leonid\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/author\\\/leonid\\\/#author\"},\"datePublished\":\"2012-10-02T15:48:51+02:00\",\"dateModified\":\"2012-10-02T15:48:51+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/#website\",\"url\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/\",\"name\":\"Blog of Leonid Mamchenkov\",\"description\":\"Life, universe, and everything else\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mamchenkov.net\\\/wordpress\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Bash directory bookmarks - Leonid Mamchenkov","description":"While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. Here's how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: [code lang=\"bash\"] # Bash Directory Bookmarks # From: http:\/\/habrahabr.ru\/post\/151484\/#habracut alias m1='alias g1=\"cd `pwd`\"' alias","canonical_url":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"VHvdD0_usx1_4DzKy_QCVcICVgX2EgA2ybELT-wl7kQ","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#blogposting","name":"Bash directory bookmarks - Leonid Mamchenkov","headline":"Bash directory bookmarks","author":{"@id":"https:\/\/mamchenkov.net\/wordpress\/author\/leonid\/#author"},"publisher":{"@id":"https:\/\/mamchenkov.net\/wordpress\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/3cf6df002a284d78fb6e9d8222ca4d102e0832035ed6bc8447008bd234e131a4?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Leonid Mamchenkov"},"datePublished":"2012-10-02T15:48:51+02:00","dateModified":"2012-10-02T15:48:51+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#webpage"},"isPartOf":{"@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#webpage"},"articleSection":"All, Linux, Programming, Sysadmin, Technology, bash, bookmarks, productivity"},{"@type":"BreadcrumbList","@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress#listItem","position":1,"name":"Home","item":"https:\/\/mamchenkov.net\/wordpress","nextItem":{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/linux\/#listItem","name":"Linux"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/linux\/#listItem","position":3,"name":"Linux","item":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/linux\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#listItem","name":"Bash directory bookmarks"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#listItem","position":4,"name":"Bash directory bookmarks","previousItem":{"@type":"ListItem","@id":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/linux\/#listItem","name":"Linux"}}]},{"@type":"Person","@id":"https:\/\/mamchenkov.net\/wordpress\/#person","name":"Leonid Mamchenkov","image":{"@type":"ImageObject","@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/3cf6df002a284d78fb6e9d8222ca4d102e0832035ed6bc8447008bd234e131a4?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Leonid Mamchenkov"}},{"@type":"Person","@id":"https:\/\/mamchenkov.net\/wordpress\/author\/leonid\/#author","url":"https:\/\/mamchenkov.net\/wordpress\/author\/leonid\/","name":"Leonid Mamchenkov","image":{"@type":"ImageObject","@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/3cf6df002a284d78fb6e9d8222ca4d102e0832035ed6bc8447008bd234e131a4?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Leonid Mamchenkov"}},{"@type":"WebPage","@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#webpage","url":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/","name":"Bash directory bookmarks - Leonid Mamchenkov","description":"While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. Here's how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: [code lang=\"bash\"] # Bash Directory Bookmarks # From: http:\/\/habrahabr.ru\/post\/151484\/#habracut alias m1='alias g1=\"cd `pwd`\"' alias","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mamchenkov.net\/wordpress\/#website"},"breadcrumb":{"@id":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/#breadcrumblist"},"author":{"@id":"https:\/\/mamchenkov.net\/wordpress\/author\/leonid\/#author"},"creator":{"@id":"https:\/\/mamchenkov.net\/wordpress\/author\/leonid\/#author"},"datePublished":"2012-10-02T15:48:51+02:00","dateModified":"2012-10-02T15:48:51+02:00"},{"@type":"WebSite","@id":"https:\/\/mamchenkov.net\/wordpress\/#website","url":"https:\/\/mamchenkov.net\/wordpress\/","name":"Blog of Leonid Mamchenkov","description":"Life, universe, and everything else","inLanguage":"en-US","publisher":{"@id":"https:\/\/mamchenkov.net\/wordpress\/#person"}}]},"og:locale":"en_US","og:site_name":"Leonid Mamchenkov - Life, universe, and everything else","og:type":"article","og:title":"Bash directory bookmarks - Leonid Mamchenkov","og:description":"While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. Here's how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: [code lang=&quot;bash&quot;] # Bash Directory Bookmarks # From: http:\/\/habrahabr.ru\/post\/151484\/#habracut alias m1='alias g1=&quot;cd `pwd`&quot;' alias","og:url":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/","og:image":"https:\/\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2026\/03\/leonid-sailing-beer.jpg","og:image:secure_url":"https:\/\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2026\/03\/leonid-sailing-beer.jpg","og:image:width":1024,"og:image:height":1024,"article:published_time":"2012-10-02T13:48:51+00:00","article:modified_time":"2012-10-02T13:48:51+00:00","article:publisher":"https:\/\/www.facebook.com\/MamchenkovBlog","twitter:card":"summary_large_image","twitter:site":"@mamchenkov","twitter:title":"Bash directory bookmarks - Leonid Mamchenkov","twitter:description":"While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell. Here's how to set it up. Firstly, add the following lines to your .bashrc or .bash_profile file: [code lang=&quot;bash&quot;] # Bash Directory Bookmarks # From: http:\/\/habrahabr.ru\/post\/151484\/#habracut alias m1='alias g1=&quot;cd `pwd`&quot;' alias","twitter:creator":"@mamchenkov","twitter:image":"https:\/\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2026\/03\/leonid-sailing-beer.jpg"},"aioseo_meta_data":{"post_id":"16781","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-07-19 20:03:52","updated":"2026-01-15 08:19:00","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/mamchenkov.net\/wordpress\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/linux\/\" title=\"Linux\">Linux<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tBash directory bookmarks\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/mamchenkov.net\/wordpress"},{"label":"Technology","link":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/"},{"label":"Linux","link":"https:\/\/mamchenkov.net\/wordpress\/category\/technology\/linux\/"},{"label":"Bash directory bookmarks","link":"https:\/\/mamchenkov.net\/wordpress\/2012\/10\/02\/bash-directory-bookmarks\/"}],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":9876,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/01\/30\/best-shell-alias-ever\/","url_meta":{"origin":16781,"position":0},"title":"Best shell alias ever","author":"Leonid Mamchenkov","date":"January 30, 2006","format":false,"excerpt":"I came across the best shell alias ever: alias up=\"cd ..\" This is one of those things that make me go \"Why didn't I thought of it earlier? And myself?\". In order to add some value to this post, here are my two mostly used aliases: alias pd=\"perldoc\" alias pdf=\"perldoc\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10039,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/04\/07\/gnu-grep-can-be-colorful\/","url_meta":{"origin":16781,"position":1},"title":"GNU grep can be colorful","author":"Leonid Mamchenkov","date":"April 7, 2006","format":false,"excerpt":"Yet another of those tiny things that I wish I discovered a billion years ago - GNU grep supports color.\u00c2\u00a0 Yup, that's right.\u00c2\u00a0 You can actually have your matches nicely highlighted in the results.\u00c2\u00a0 All you have to do to use this beauty is run grep --color instead of just\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27363,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/02\/26\/composer-require-inline-alias\/","url_meta":{"origin":16781,"position":2},"title":"Composer require inline alias","author":"Leonid Mamchenkov","date":"February 26, 2017","format":false,"excerpt":"Here's a feature of composer that I didn't know about until a few days ago - require inline alias. \u00a0Here's the example from the documentation: [code] { \"repositories\": [ { \"type\": \"vcs\", \"url\": \"https:\/\/github.com\/you\/monolog\" } ], \"require\": { \"symfony\/monolog-bundle\": \"2.0\", \"monolog\/monolog\": \"dev-bugfix as 1.0.x-dev\" } } [\/code] This is super\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27487,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/04\/09\/sshrc-bring-your-bashrc-vimrc-etc-with-you-when-you-ssh\/","url_meta":{"origin":16781,"position":3},"title":"sshrc &#8211; bring your .bashrc, .vimrc, etc. with you when you ssh","author":"Leonid Mamchenkov","date":"April 9, 2017","format":false,"excerpt":"sshrc looks like a handy tool, for those quick SSH sessions to machines, where you can't setup your full environment for whatever reason (maybe a shared account or automated templating or restricted access). \u00a0Here's a description from the project page: sshrc works just like ssh, but it also sources the\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9803,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/01\/06\/daily-del-icio-us-bookmarks\/","url_meta":{"origin":16781,"position":4},"title":"Daily del.icio.us bookmarks","author":"Leonid Mamchenkov","date":"January 6, 2006","format":false,"excerpt":"Shared bookmarks for del.icio.us user tvset on 2006-01-05 GREP tutorial Tagged as: bash gnu grep howto linux reference software sysadmin tutorial unix","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16525,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/07\/20\/workaround-for-cygwin-path-issues\/","url_meta":{"origin":16781,"position":5},"title":"Workaround for Cygwin path issues","author":"Leonid Mamchenkov","date":"July 20, 2012","format":false,"excerpt":"A colleague of mine had a problem with his Cygwin setup. \u00a0For some reason, he couldn't just run \"mysql\" to start his MySQL command-line client. \u00a0The error that he was getting back was: [code lang=\"bash\" light=\"true\"] $ mysql sh.exe: mysql.exe: command not found [\/code] Typing the full path to mysql.exe\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/16781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=16781"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/16781\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=16781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=16781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=16781"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=16781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}