The common options directory is present without an error (at this time there is no effect on the directory), there is the creation of mkdir-p, if there is a need to create a parent directory when creating a directory when the parent directory is created Mkdir-m example: Create a multilevel directory Mkdir-p A/B/C/D (create a directory, and in A directory to create a B directory, under the B directory to create a C directory, in the C directory to create a D directory to create a multi-level directory Mkdir-p A/{B1,B2,B3/{C1,C2,C3},B4} (Create a directory, under the A directory to create B1,B2,B3,B4 directory, Create the C1,C2,C3 directory under the B3 directory) when you create the directory and specify the directory permissions mkdir-m0666 A, create a directory, and the A directory is 0666, of course, if the a directory exists, then this command is not valid, this command does not modify the existing properties of a directory note: before someone mentioned What is the difference between that and mkdir * 2>/dev/null, the difference is mkdir-p an existing directory, will not error The result is successful, and mkdir * 2>/dev/null just the wrong results redirect masked out, but the result is a failure, can echo $? Look at the result verification.
Shell Share mkdir command