This is a fairly simple trick on how to avoid the warning message you
get when you use
mkdir to create a new directory, but the directory
you want to create already exists. Quite useful when doing bash
scripts or automating your environment for instance.
This is the default behaviour of the
$ mkdir my_directory $ mkdir my_directory $ mkdir: my_directory: File exists
I would recommend to do this to check if the directory actually
exist before trying to
$ [ -d my_directory ] || mkdir my_directory
This is another way we can avoid the warning message:
$ mkdir my_directory $ mkdir -p my_directory
-p parameter. If the directory you want to create
already exists, this will not return any messages in the command line.