![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Create Shortcuts to Long and Complicated Paths in Linux (Gogo)\n
Gogo is a tool to bookmark directories with long and complicated paths in the Unix shell. Because the long parts are difficult to remember and cumbersome to type in. In this article we'll see how to install go go and use it.
Installing git
We first need to have git installed in our system which will be needed for gogo installation. To install git in an Ubuntu system follow the below command.
$ sudo apt install git
Running the above code gives us the following result −
[sudo] password for ubuntu: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: git-man liberror-perl ………. ………….. Setting up liberror-perl (0.17-1.2) ... Setting up git-man (1:2.7.4-0ubuntu1.7) ... Setting up git (1:2.7.4-0ubuntu1.7) ...
Cloning gogo
After git is successfully installed, we clone gogo into the system using the below repository.
$ git clone https://github.com/mgoral/gogo.git
Running the above code gives us the following result:
Cloning into 'gogo'... remote: Enumerating objects: 85, done. remote: Total 85 (delta 0), reused 0 (delta 0), pack-reused 85 Unpacking objects: 100% (85/85), done. Checking connectivity... done.
Copying gogo to bin
Next we create a bin directory in the user’s home directory in case it is not already there and copy gogo to this directory. We will execute gogo from this location.
mkdir -p ~/bin cp gogo/gogo.py ~/bin/
Add gogo to bash
Next we add gogo to bash profile and verify that it is added successfully.
cat gogo.sh >> ~/.bashrc tail ~/.bashrc
Running the above code gives us the following result:
# Gogo from anywhere. function gogo { CMD=`gogo.py $@` RET=$? eval "$CMD" return $RET }
Using gogo
Now we can use gogo by going into the directory whose alias we want cerate. First let’s see the current configuration of gogo.
$ gogo -l
Running the above code gives us the following result −
Current gogo configuration (sorted alphabetically): - : - default : /home/ubuntu gogo : ~/.config/gogo sshloc : ssh://ubuntu@127.0.0.1:/bin/bash /home/ubuntu
Next go into the directory whose alias you want to create. When Inside the directory, execute the gogo –a command to cerate the alias which can be used from anywhere.
$ pwd /home/ubuntu/Documents/tutorials/linux # Create an alias named lt to this directory $ gogo -a lt $ gogo -l Current gogo configuration (sorted alphabetically): - : - default : /home/ubuntu gogo : ~/.config/gogo lt : /home/ubuntu/Documents/tutorials/linux sshloc : ssh://ubuntu@127.0.0.1:/bin/bash /home/ubuntu # Go home and type the alias $ cd ~ $ gogo lt ubuntu@ubuntu:~/Documents/tutorials/linux$