< Previous | Contents | Next >
Creating Directories
The mkdir command is used to create a directory. To create our playground directory we will first make sure we are in our home directory and will then create the new directory:
[me@linuxbox ~]$ cd
[me@linuxbox ~]$ mkdir playground
[me@linuxbox ~]$ cd
[me@linuxbox ~]$ mkdir playground
To make our playground a little more interesting, let's create a couple of directories inside
it called “dir1” and “dir2”. To do this, we will change our current working directory to
playground and execute another mkdir:
[me@linuxbox ~]$ cd playground
[me@linuxbox playground]$ mkdir dir1 dir2
[me@linuxbox ~]$ cd playground
[me@linuxbox playground]$ mkdir dir1 dir2
Notice that the mkdir command will accept multiple arguments allowing us to create both directories with a single command.