Our next command is cd, which stands for “change directory.” Just as you would click on a folder in Windows Explorer or Finder, cd switches you into the directory you specify. In other words, cd changes the working directory.

Let’s say the directory we change into is drama:

$ cd drama

When a file, directory, or program is passed into a command, it is called an argument. Here the drama directory is an argument for the cd command.

If we wanted to go from the movies-rpi directory to the historical directory, we can use one cd command with a longer argument:

$ cd drama/historical

Here, we navigated directly to the historical directory, which is in the drama directory.

To move up one directory, we use cd ..:

$ cd ..

Here, cd .. navigates up from drama/historical/ to drama/.



Our current working directory is:


Transfer into the action directory.


We are currently in the action directory. Use the cd .. command to go back to the movies-rpi directory.

Remember, you can access the layout of the filesystem here.


We should be in:


If this is not the case, navigate back to movies-rpi before starting.

Change the directory to the comedy/slapstick/ directory using:

$ cd comedy/slapstick

This brings us down one level to comedy and then down once more into the slapstick directory.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?