You say that,
When I execute mkdir -p folder
I won't see any errors even warnings.
You will see an error if the command fails. The -p
flag only suppresses errors if the directory already exists.
touch x
mkdir -p x
mkdir: cannot create directory ‘x’: File exists
The same issue will occur if you try to create a directory as a normal user in, say, /etc
.
What the -p
will suppress are errors that would be triggered when the target directory already exists
mkdir y
mkdir -p y
However in all cases you won't lose anything, and nothing will be changed. In the error situations you just won't have the directory you were expecting.