The Linux mkdir command is used to create a directory of the specified name, requiring the user who created the directory to have write permissions in the current directory, and the specified directory name cannot be a directory that is already in the current directory.
1 . Command format:
mkdir [Options ] Catalogue ...
2 . Command function:
throughmkdircommand can be implemented at the specified location to create aDirName (the specified file name)the named folder or directory. The user who creates the folder or directory must have write permissions to the parent folder of the folder that is created. Also, the folders that are created(Catalogue)cannot be associated with its parent directory(that is, the parent folder)the name of the file in the same directory cannot have the same name(Case Sensitive).
3 . Command parameters:
-M,--mode= mode, set permissions < Mode > ( similar to chmod) , but not rwxrwxrwx minus umask
-P,--parents can be a path name. In this case, if some directories in the path do not already exist, and with this option, the system will automatically establish those that do not already exist, that is, multiple directories can be established at one time;
-V,--verbose displays information each time a new directory is created
--HELP Display this help message and exit
--version output version information and exit
4 . Command instance:
Example 1 : Create an empty directory
Command:
mkdir test1
Output:
Example 2 : Create multiple directories recursively
Command:
Mkdir-p test2/test22
Output:
Example 3 : Create permissions for 777 the directory
Command:
Mkdir-m 777 Test3
Output:
Description
Test3 permissions are rwxrwxrwx
Example 4 : Create new directory displays information
Command:
Mkdir-v test4
Output:
Example five: a command to create a directory structure for a project
Reference: http://www.ibm.com/developerworks/cn/aix/library/au-badunixhabits.html
Command:
MKDIR-VP Scf/{lib/,bin/,doc/{info,product},logs/{info,product},service/deploy/{info,product}}
Output:
Linux command detailed-mkdir