Learn
Navigation
mkdir

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.

Instructions

1.

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.

2.

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

3.

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.

Use:

$ mkdir media/tv

to create a new directory named tv inside media.

Folder Icon

Sign up to start coding

Already have an account?