{"id":12471,"date":"2019-03-27T01:59:20","date_gmt":"2019-03-27T01:59:20","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12471"},"modified":"2019-03-27T01:59:20","modified_gmt":"2019-03-27T01:59:20","slug":"gogo-create-shortcuts-to-long-and-complicated-paths-in-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/27\/gogo-create-shortcuts-to-long-and-complicated-paths-in-linux\/","title":{"rendered":"Gogo \u2013 Create Shortcuts to Long and Complicated Paths in Linux"},"content":{"rendered":"<p><strong>Gogo<\/strong>\u00a0is an impressive way to bookmark directories inside your shell. It allows you to create shortcuts to long and complicated paths in Linux. This way, you don\u2019t have to type or remember long and complicated paths anymore in Linux.<\/p>\n<p>For example, if you have a directory\u00a0<strong>~\/Documents\/Phone-Backup\/Linux-Docs\/Ubuntu\/<\/strong>, using\u00a0<strong>gogo<\/strong>, you can create an alias (a shortcut name), for instance\u00a0<code>Ubuntu<\/code>\u00a0to access it without typing the whole path anymore. No matter your current working directory, you can move into\u00a0<strong>~\/cd Documents\/Phone-Backup\/Linux-Docs\/Ubuntu\/<\/strong>by simply using the alias\u00a0<code>Ubuntu<\/code>.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/bd-quickly-go-back-to-a-linux-parent-directory\/\" target=\"_blank\" rel=\"noopener\">bd \u2013 Quickly Go Back to a Parent Directory Instead of Typing \u201ccd ..\/..\/..\u201d Redundantly<\/a><\/p>\n<p>In addition, it also allows you to create aliases for connecting directly into directories on remote Linux servers.<\/p>\n<h3>How to Install Gogo in Linux Systems<\/h3>\n<p>To install\u00a0<strong>Gogo<\/strong>, first clone the\u00a0<strong>gogo<\/strong>\u00a0repository from Github and then copy the\u00a0<code>gogo.py<\/code>\u00a0to any directory in your\u00a0<strong>PATH<\/strong>\u00a0environmental variable (if you already have the\u00a0<code>~\/bin\/<\/code>\u00a0directory, you can place it here, otherwise create it).<\/p>\n<pre>$ git clone https:\/\/github.com\/mgoral\/gogo.git\r\n$ cd gogo\/\r\n$ mkdir -p ~\/bin        #run this if you do not have <strong>~\/bin<\/strong> directory\r\n$ cp gogo.py ~\/bin\/\r\n<\/pre>\n<div id=\"attachment_28846\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Install-Gogo-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28846\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Install-Gogo-in-Linux.png\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Install-Gogo-in-Linux.png 833w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Install-Gogo-in-Linux-768x203.png 768w\" alt=\"Install Gogo in Linux\" width=\"833\" height=\"220\" aria-describedby=\"caption-attachment-28846\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28846\" class=\"wp-caption-text\">Install Gogo in Linux<\/p>\n<\/div>\n<p>Then add a function from\u00a0<code>gogo.sh<\/code>\u00a0to your\u00a0<code>~\/.bashrc<\/code>\u00a0(for Bash) or\u00a0<code>~\/.zshrc<\/code>\u00a0(for Zsh) file and verity it as shown.<\/p>\n<pre>$ cat gogo.sh &gt;&gt; ~\/.bashrc\r\n$ tail  ~\/.bashrc\r\nOR\r\n$ cat gogo.sh &gt;&gt; ~\/.zshrc \r\n<\/pre>\n<div id=\"attachment_28847\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Add-Gogo-Function-to-Bashrc.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28847\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Add-Gogo-Function-to-Bashrc.png\" alt=\"Add Gogo Function to Bashrc\" width=\"699\" height=\"234\" aria-describedby=\"caption-attachment-28847\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28847\" class=\"wp-caption-text\">Add Gogo Function to Bashrc<\/p>\n<\/div>\n<h3>How to Use Gogo in Linux Systems<\/h3>\n<p>To start using\u00a0<strong>gogo<\/strong>, you need to logout and login back to use it. Gogo stores its configuration in\u00a0<code>~\/.config\/gogo\/gogo.conf<\/code>\u00a0file (which should be auto created if it doesn\u2019t exist) and has the following syntax.<\/p>\n<pre># Comments are lines that start from '#' character.\r\ndefault = ~\/something\r\nalias = \/desired\/path\r\nalias2 = \/desired\/path with space\r\nalias3 = \"\/this\/also\/works\"\r\nza\u017c\u00f3\u0142\u0107 = \"unicode\/is\/also\/supported\/za\u017c\u00f3\u0142\u0107 g\u0119\u015bl\u0105 ja\u017a\u0144\"\r\n<\/pre>\n<p>If you run\u00a0<strong>gogo<\/strong>\u00a0run without any arguments, it will go to the directory specified in default; this alias is always available, even if it\u2019s not in the configuration file, and points to\u00a0<strong>$HOME<\/strong>\u00a0directory.<\/p>\n<p>To display the current aliases, use the\u00a0<code>-l<\/code>\u00a0switch. From the following screenshot, you can see that default points to\u00a0<code>~\/home\/tecmint<\/code>\u00a0which is user\u00a0<strong>tecmint\u2019s<\/strong>\u00a0home directory on the system.<\/p>\n<pre>$ gogo -l   \r\n<\/pre>\n<div id=\"attachment_28848\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/List-Gogo-Aliases.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28848\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/List-Gogo-Aliases.png\" alt=\"List Gogo Aliases\" width=\"664\" height=\"150\" aria-describedby=\"caption-attachment-28848\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28848\" class=\"wp-caption-text\">List Gogo Aliases<\/p>\n<\/div>\n<p>Below is an example of running\u00a0<strong>gogo<\/strong>\u00a0without any arguments.<\/p>\n<pre>$ cd Documents\/Phone-Backup\/Linux-Docs\/\r\n$ gogo\r\n$ pwd\r\n<\/pre>\n<div id=\"attachment_28849\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Gogo-Listing.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28849\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Gogo-Listing.png\" alt=\"Running Gogo Without Options\" width=\"661\" height=\"105\" aria-describedby=\"caption-attachment-28849\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28849\" class=\"wp-caption-text\">Running Gogo Without Options<\/p>\n<\/div>\n<p>To create a shortcut to a long path, move into the directory you want and use the\u00a0<code>-a<\/code>\u00a0flag to add an alias for that directory in\u00a0<strong>gogo<\/strong>, as shown.<\/p>\n<pre>$ cd Documents\/Phone-Backup\/Linux-Docs\/Ubuntu\/\r\n$ gogo -a Ubuntu\r\n$ gogo\r\n$ gogo -l\r\n$ gogo -a Ubuntu\r\n$ pwd\r\n<\/pre>\n<div id=\"attachment_28850\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Create-Gogo-Shortcut.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28850\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Create-Gogo-Shortcut.png\" alt=\"Create Long Directory Shortcut \" width=\"739\" height=\"270\" aria-describedby=\"caption-attachment-28850\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28850\" class=\"wp-caption-text\">Create Long Directory Shortcut<\/p>\n<\/div>\n<p>You can also create aliases for connecting directly into directories on a remote Linux servers. To do this, simple add the following lines to gogo configuration file, which can be accessed using\u00a0<strong>-e<\/strong>\u00a0flag, this will use the editor specified in the\u00a0<strong>$EDITOR env<\/strong>\u00a0variable.<\/p>\n<pre>$ gogo -e\r\n<\/pre>\n<p>One configuration file opens, add these following lines to it.<\/p>\n<pre>sshroot = ssh:\/\/root@192.168.56.5:\/bin\/bash  \/root\/\r\nsshtdocs = ssh:\/\/tecmint@server3  ~\/tecmint\/docs\/\r\n<\/pre>\n<div id=\"attachment_28851\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Gogo-Configuration-File.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28851\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Gogo-Configuration-File.png\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Gogo-Configuration-File.png 933w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Gogo-Configuration-File-768x398.png 768w\" alt=\"Gogo Configuration File\" width=\"933\" height=\"484\" aria-describedby=\"caption-attachment-28851\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28851\" class=\"wp-caption-text\">Gogo Configuration File<\/p>\n<\/div>\n<p>To display the gogo help message, use the\u00a0<code>-h<\/code>\u00a0option.<\/p>\n<pre>$ gogo -h\r\n<\/pre>\n<p>One notable limitation of\u00a0<strong>gogo<\/strong>\u00a0is its lack of support for auto-completion \u2013 when accessing subdirectories\/child directories under an aliased long path.<\/p>\n<p><strong>Gogo github repository<\/strong>:\u00a0<a href=\"https:\/\/github.com\/mgoral\/gogo\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/mgoral\/gogo<\/a><\/p>\n<p><strong>Gogo<\/strong>\u00a0is a remarkable way that comes in handy, for creating shortcuts to long and complicated paths in Linux. Try it out and share your thoughts about it or ask any questions via the comment form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/gogo-create-shortcuts-to-long-directory-paths-in-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gogo\u00a0is an impressive way to bookmark directories inside your shell. It allows you to create shortcuts to long and complicated paths in Linux. This way, you don\u2019t have to type or remember long and complicated paths anymore in Linux. For example, if you have a directory\u00a0~\/Documents\/Phone-Backup\/Linux-Docs\/Ubuntu\/, using\u00a0gogo, you can create an alias (a shortcut name), &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/27\/gogo-create-shortcuts-to-long-and-complicated-paths-in-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Gogo \u2013 Create Shortcuts to Long and Complicated Paths in Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12471","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12471"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12471\/revisions"}],"predecessor-version":[{"id":12472,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12471\/revisions\/12472"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}