unix filesystem directories

The cd command allows you to change directories.

To change to your home directory:


To change to your scratch directory (if your username is csmajor1):

cd /scratch/csmajor1

To move up one level, no matter where you are:

cd ..

You can also use the full path to change to your cs21/labs/00 directory:

cd /home/csmajor1/cs21/labs/00

Or go one step at a time:

cd cs21
cd labs
cd 00

Use the tilde (~) shortcut to get to your cs21/labs/00 directory:

cd ~/cs21/labs/00

To switch from your cs21/labs/00 directory into your cs21/labs/01 directory:

cd ..
cd 01

Or again, in just one line:

cd ../01

Here’s a view of the unix filesystem tree:

unix filesystem tree
unix filesystem tree

Back to SwatCS Help Docs