Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Gogo - A Tool to Create Shortcuts to Lengthy Path Directories  (Read 1351 times)

0 Members and 1 Guest are viewing this topic.

joseletk

  • Guest
 In this article, I would like to tell about such interesting tool called gogo. It is used to bookmark any directory from your command line so that you don't have to remember long and complicated paths.

Installation

For this purposes, I will use Ubuntu 16.04

Code: [Select]
$ https://github.com/mgoral/gogo/archive/master.zip
And unzip

Code: [Select]
$ unzip master.zip
Copy script to any directory included in your $PATH

$ mkdir -p ~/bin && cp gogo-master/gogo.py ~/bin/ && chmod +x ~/bin/gogo.py

Add function from script to .bashrc file and source it

Code: [Select]
$ cp gogo-master/gogo.sh ~/.gogo.sh && echo "source ~/.gogo.sh" >> ~/.bashrc
Configuration

gogo stores configuration file in ~/.config/gogo/gogo.conf

The syntax of this configuration file in quite easy. You can add comments starting with # and add aliases such

Code: [Select]
path = /full/path/to/directory
You can also add aliases for directories on another server using ssh. You can use common ssh format like 'user@server' or an alias stored in ~/.ssh/config file

Code: [Select]
server1music = ssh://user@server /home/user/Music
or use the needed shell

Code: [Select]
server1music = ssh://user@server:bash /home/user/Music
otherwise the host computer shell will be used.

Example

Let's add some test config. For example alias for "Pictures" folder.

Code: [Select]
$ echo "pic = ~/Pictures" >> ~/.config/gogo/gogo.conf
Now execute

Code: [Select]
$ gogo pic
and you will get changed directory to ~/Pictures

This tool is very useful if you have a lot of directories with files and you do not want to remember all of the paths.

=======================================================================================================