HomeLinuxCreate Shortcuts to Listing Paths in Linux

Create Shortcuts to Listing Paths in Linux


Gogo is a powerful strategy to bookmark directories inside your Linux shell. It means that you can create shortcuts to lengthy and sophisticated paths in Linux. This fashion, you don’t need to kind or bear in mind lengthy and sophisticated paths anymore in Linux.

For instance, in case you have a listing ~/Paperwork/Telephone-Backup/Linux-Docs/Ubuntu/, utilizing gogo, you may create an alias (a shortcut title), as an illustration Ubuntu to entry it with out typing the entire path anymore.

Irrespective of your present working listing, you may transfer into ~/cd Paperwork/Telephone-Backup/Linux-Docs/Ubuntu/ by merely utilizing the alias Ubuntu.

As well as, it additionally means that you can create aliases for connecting on to directories on distant Linux servers over an ssh connection.

Find out how to Set up Gogo in Linux Techniques

To put in Gogo, first clone the gogo repository from Github after which copy the gogo.py to any listing in your PATH environmental variable (if you have already got the ~/bin/ listing, you may place it right here, in any other case create a bin listing).

$ git clone https://github.com/mgoral/gogo.git
$ cd gogo/
$ mkdir -p ~/bin        #run this should you don't have ~/bin listing
$ cp gogo.py ~/bin/
Install Gogo in Linux
Set up Gogo in Linux

Then add a operate from gogo.sh to your ~/.bashrc (for Bash) or ~/.zshrc (for Zsh) file and confirm it utilizing the tail command as proven.

$ cat gogo.sh >> ~/.bashrc
$ tail  ~/.bashrc
OR
$ cat gogo.sh >> ~/.zshrc 
Add Gogo Function to Bashrc
Add Gogo Operate to Bashrc

Find out how to Use Gogo in Linux Techniques

To begin utilizing gogo, you want to log off and log in again to make use of it. Gogo shops its configuration in ~/.config/gogo/gogo.conf file (which ought to be auto-created if it doesn’t exist) and has the next syntax.

# Feedback are traces that begin from '#' character.
default = ~/one thing
alias = /desired/path
alias2 = /desired/path with area
alias3 = "/this/additionally/works"
zażółć = "unicode/is/additionally/supported/zażółć gęślą jaźń"

In case you run gogo with none arguments, it is going to go to the listing laid out in default; this alias is at all times accessible, even when it’s not within the configuration file, and factors to the $HOME listing.

To show the present aliases, use the -l swap. From the next screenshot, you may see that the default factors to ~/residence/tecmint which is consumer tecmint’s residence listing on the system.

$ gogo -l   
List Gogo Aliases
Record Gogo Aliases

Beneath is an instance of operating gogo with none arguments.

$ cd Paperwork/Telephone-Backup/Linux-Docs/
$ gogo
$ pwd
Running Gogo Without Options
Operating Gogo With out Choices

To create a shortcut to an extended path, transfer into the listing you need and use the -a flag so as to add an alias for that listing in gogo, as proven.

$ cd Paperwork/Telephone-Backup/Linux-Docs/Ubuntu/
$ gogo -a Ubuntu
$ gogo
$ gogo -l
$ gogo -a Ubuntu
$ pwd
Create Long Directory Shortcut
Create a Lengthy Listing Shortcut

You can too create aliases for connecting on to directories on a distant Linux server. To do that, merely add the next traces to a gogo configuration file, which will be accessed utilizing -e flag, this can use the editor specified within the $EDITOR env variable.

$ gogo -e

One configuration file opens, add the next traces to it.

sshroot = ssh://[email protected]:/bin/bash  /root/
sshtdocs = ssh://[email protected]  ~/tecmint/docs/
Gogo Configuration File
Gogo Configuration File

To show the gogo assist message, use the -h choice.

$ gogo -h

One notable limitation of gogo is its lack of assist for auto-completion – when accessing subdirectories/youngster directories beneath an aliased lengthy path.

Gogo github repository: https://github.com/mgoral/gogo

Gogo is a exceptional approach that is useful, for creating shortcuts to lengthy and sophisticated paths in Linux. Strive it out and share your ideas about it or ask any questions through the remark type beneath.

If You Recognize What We Do Right here On TecMint, You Ought to Think about:

TecMint is the quickest rising and most trusted neighborhood website for any type of Linux Articles, Guides and Books on the net. Tens of millions of individuals go to TecMint! to look or browse the hundreds of printed articles accessible FREELY to all.

In case you like what you’re studying, please contemplate shopping for us a espresso ( or 2 ) as a token of appreciation.

Support Us

We’re grateful to your by no means ending assist.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments