mkdir, touch Creating Directories and Files

mkdir (MaKe DIRectory) is used to create directories. Its syntax is simple:
mkdir [options] [directory ...]
Only one option is worth noting: the -p option. It does two things:
1. it will create parent directories if they did not exist previously. Without this option, mkdir would just fail, complaining that the said parent directories do not exist;
2. it will return silently if the directory you wanted to create already exists. Similarly, if you did not specify the -p option, mkdir will send back an error message, complaining that the directory already exists.
Here are some examples:
• mkdir foo: creates a directory foo in the current directory;
• mkdir -p images/misc docs: creates the misc directory in the images directory. First, it creates the latter if it does not exist (-p); it also creates a directory named docs in the current directory.
Initially, the touch command was not intended for creating files but for updating file access and modification times1. However, touch will create the files listed as empty files if they do not exist. The syntax is:
touch [options] file [file...]
So running the command:
touch file1 images/file2
will create an empty file called file1 in the current directory and an empty file file2 in directory images, if the files did not previously exist.