Now that we can traverse the existing filesystem, let’s try editing it by making directories (folders) through the command line. The command for that is mkdir:

$ mkdir media

The mkdir command stands for “make directory”. It takes in a directory name as an argument and then creates a new directory in the current working directory.

Here we used mkdir to create a new directory named media/ inside our working directory.



Navigate to the /home/ccuser/workspace/blog/2014/dec/ directory.

Then list all files and directories in the working directory to see what’s currently in there.


Create a new directory named media. If you list the contents of the working directory again, you should see your new directory.


We’ve made our new media directory, but what if we wanted to create another directory inside that one? We could cd into media and then use mkdir, or we could make the new directory from our current position by using a / to combine arguments as we did in the last lesson.


$ mkdir media/tv

to create a new directory named tv inside media.

Sign up to start coding

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?