Skip to Main Content

Linux Terminal

ls & cd

These two commands are useful for navigating through Linux. ls will list the contents of the directory you are in. cd will go to the directory specified. An example is shown below with the desktop folders shown on the left side for reference.

The following table presents the four most common variations of cd.

Function

Command

Navigate to the root directory

cd /

Navigate to home directory

cd ~ 

Navigate back one directory

cd ..

Navigate to the previous directory

cd -