Here is an great time saver for those that regularly work from the command line. There are many instances where someone will need to use the command line from a terminal window, building a kernel is a common one. For this example create this folder tree from your root folder: mkdir -p ~/subfolder1/subFolder2/targetFolder/{dir1.dir2,dir3}
Now tell BASH where directories dir1, dir2 and dir3 can be found by typing at the prompt:
export CDPATH=~/subfolder1/subFolder2/targetFolder
Next test to see if this worked. First type at the prompt:
cd dir1
Did this work? Next type:
cd dir2
Easy wasn’t it? What CDPATH does is to tell bash to look under the folder named targetFolder for directories that it doesn’t find in the current folder where the cd command was executed. You can easily add this to the end of the bashrc file. Open bashrc in your home folder. Tip: it is a hidden file. At the end of the file type: CDPATH=~/subfolder1/subFolder2/targetFolder
Now each time you open a terminal window, the CDPATH is remembered so you don’t have to reenter it each time a new terminal is opened.
This tip was tested using Ubuntu 11.10 on a quad processor machine.