Last updated on December 2nd, 2017 at 08:41 pm
Linux files system uses cd (change directory) command to navigate into the directories. You can use this command in two ways either provide full path of the directory which is called absolute path or just give directory name which is also known as relative path.
Let’s see practical example:
For example if we take the previous lecture directories, we started the terminal and use pwd command, the output was /home/haider which is indicating that we are logged in as user haider and standing in the home directory of user haider. Then we change our director to BroExperts which is subdirectory of /home/haider directory.
command we used:
So in this example we use only the directory name to move into BroExperts directory. Because our present working directory is parent directory of BroExperts.
Let’s see other example; now we want to change directory which is called LinuxBasics which is located at /tmp/LinuxBasics but our current location is /home/haider/BroExperts.
In this case you need to run:
The full path of LinuxBasics Directory.
If you want to quickly move into once step back from your present working directory, run:
Or if you want to switch back to previous working directory, run:
I hope above mentioned examples giving clear understanding of using change directory command. I recommend you to do practice of this lecture at least 3 to 4 times. If you have any question please leave comment and don’t forget to say thanks, as it’s free. :)
I am Hafiz Haider, co-founder of BroExperts.com. A Computer Geek and a certified Linux enthusiast (RHCE, RHCSA), who strongly believes in sharing knowledge.. You can reach me at email@example.com.