Always we hate to type or search or copy and paste most often used commands in the terminal.
I found a great tool to ease the navigation in the terminal, called Apparix. It lets you bookmark a folder so that you easily can navigate to it just by typing
to nameofbookmark
To install apparix in Ubuntu, type
sudo apt-get install apparix
To install in Mac, type
brew install -v apparix
or Run this Script
in a terminal window.
After installation, you need to set up the aliases bm
for bookmarking and to
for going to a bookmark by adding a few functions to your .bashrc file
in your home folder (if you don’t have this file, you can create it yourself).
You’ll find the functions you need to add by issuing the command
apparix –shell-examples
in a terminal window. Copy everything below Bash-style functions except the CSH-style aliases. Paste this into your .bashrc file
.
Open up a new terminal, cd to your directory of choice and type
bm mybookmark
to bookmark the folder. Afterward, you can go to any folder and type
to mybookmark
to go to your bookmark.
This tool is, of course, available for other Linux distributions too.
Reference: https://micans.org/apparix/