Training Missions

Missions: Using command line shell

Using cd to change directory

cd: change directory

The cd command will allow you to change directories. When you open a terminal you will be in your home directory. To move around the file system you will use cd. Examples:

To navigate into the root directory, use: $ cd /

To navigate to your home directory, use:$ cd or $ cd ~

To navigate up one directory level, use:$ cd ..

To navigate to the previous directory (or back), use $ cd -

To navigate through multiple levels of directory at once, specify the full directory path that you want to go to. For example, use, $ cd /var/www to go directly to the /www subdirectory of /var/. As another example, $ cd ~/Desktop will move you to the Desktop subdirectory inside your home directory.


Suppose your current working directory is /penguin/projects, what does the command cd without a directory name do?

It has no effect.
It changes the working directory to /.
It changes the working directory to the user's home directory.
It produces an error message.