I am aware this may be a duplicate, and if so, I will delete it.
What is the easiest way to navigate to a deep directory without having to type the directory every time. I do a lot of stuff in the same folders but every time I open a new terminal, I have to navigate to the directory again.
So far, I have been using variables in .bashrc, but is there an easier way than
cd $data
to get somewhere? For example, if I want to just be able to type "data" and be navigated to one of my data folders, how do I go about that?
Just make an alias for the respective command in
~/.bashrc
.And run
source ~/.bashrc
. After that you can just typedata
in terminal and it will take you thereMy first thought was what Sergiy posted, but an alternative is to create a symbolic link in your home directory:
Now you can just
cd data
( from your home directory, otherwise it'scd ~/data
) when you want to get there. This has the added advantage that if you open nautilus and want to go there graphically you can also just click on the data link in your home directory.Use
cdable_vars
:Or
autocd
From the manual:
It would have been brilliant if we could combine the two, but the two seem to be mutually exclusive in scope.