Changing Directories with cd

NOTE: this website is under construction for the new quarter. Please pardon our dust! The content of this website is subject to change as we put together resources for the new quarter. If you are a student who took the course last quarter, you should visit last quarter's class web site instead, accessible by visiting this link.

Written by Chris Gregg, with modifications by Nick Troccoli

Click here for a walkthrough video.

The cd command is used to change the directory where you are currently working. The command accepts absolute or relative paths, and you will use it every time you log onto the myth computers.

If you are someplace in the filesystem and you want to go down a level into a folder, you can do this:

$ ls
file2.c  Makefile  myfile.txt  MyFolder
$ cd MyFolder
$ ls
item1.txt  item2.txt

To change to your home directory:

cd ~

or

cd

To change to the parent directory:

cd ..

To change to a sibling directory:

cd ../siblingName