Mkdir command in CentOS
Mkdir: the abbreviation of make directory (ies), used to create a directory
1. Syntax
Mkdir [OPTION]... DIRECTORY
Note: option is a selection and optional. directory is the name of the directory to be created.
2. Options
3. Parameters
Directory: Specify the directory to be created. multiple directories are separated by spaces.
4. Instances
[Root @ oldboy/] # mkdir oldboy # create the oldboy directory under the root/directory
[Root @ oldboy/] # mkdir oldboy # If the directory already exists, you cannot create a directory.
Mkdir: Unable to create directory "oldboy": The file already exists
[Root @ oldboy/] # mkdir-p oldboy/test/geng #-p is a recursive directory. If a file exists, it will not be treated as an error. If the file does not exist, create a directory layer by layer.
-V parameter to display the Directory creation process:
[Root @ oldboy/] # mkdir-p oldboy/a/B/c-v #-v parameter indicates the Directory creation process.
Mkdir: You have created the directory "oldboy/a" # first create directory
Mkdir: directory "oldboy/a/B" # create directory B
Mkdir: the directory "oldboy/a/B/c" has been created. # create directory c.
Note: The-p parameter is commonly used to create a directory recursively. If a directory exists, no error occurs. The-v parameter shows the Directory creation process, which is not commonly used, beginners can refer to the Directory creation process to understand how the-p parameter is recursively created.