mkdir -p /path/to/something
when does the above command exit with nonzero exit status?
Does it happen, if and only if /path/to/something
doesn't exist as any file (or as a directory?) before running the command and the command fails to create it as a directory?
man mkdir
says
-p, --parents
no error if existing, make parent directories as needed
Thanks.
mkdir -p /dev/i/am/a/hacker
as non-root and see it fail. If you don't have permissions it will fail and return a non-zero value. – cylgalad May 08 '18 at 07:25