Course Overview

/

Changing Directories

Changing Directories

Changing Directories

In every Unix/Linux based Operating System (OS), there is a need to be able to change directory. Moving from one folder to another is a fundamental part of using any OS. However, there is a need with Unix/Linux based OS's to achieve via the Command Line Interface (CLI):

Changing Directories via The Terminal

· pwd

· cd /home/kali

· cd /home

· cd /etc

· cd ..

cd

The structure that needs to be remembered is the use of the command "cd" followed by the directory you want to go to. In one of the above cases we are wanting to go to "/etc". For the command to work we need to make sure "cd" is stated at the start and then the directory "/etc", therefore making the final command as: "cd /etc".

cd ..

To come back a directory without listing the full directory path you can use the command "cd ..". This will bring you back up one through the directory path. For example, we may be in the following directory path of "/home/kali" but we want to change directory to "/home"; in the terminal we use the command of "cd .." to change directory from "/home/kali" to "/home".

pwd

To see where you are within the file directory you can use the command "pwd", which will "print working directory" and show you what directory path you are working within.