Creating directories#
There's not really much to creating directories:
1 |
|
And you'll get a directory called mydirectory
in the current working directory (.
). You can also create a directory at another location, either relative from your current location or absolutely, somewhere else.
If I wanted to create a directory inside another directory, I could do this:
1 |
|
Which means I'm creating a new directory called new_directory
inside of existing_directory
. But I can also create a new directory anywhere on the file system being using an absolute path:
1 |
|
Which would create a directory called my_files
at /home/myusername/
.
Finally, if you want to create a series of directories inside of each other, without having to create them one by one, you can use the -p
flag to create all the non-existent parent directories:
1 |
|
If we assume 1/
doesn't exist, then everything from 1/
onwards will be created for you.