mkdir command
mkdir command
mkdir command Introduction
mkdir command to create empty directories specified name, create a user has the required permissions in the current directory, and to develop the directory name can not be the current directory has a directory.
Syntax
mkdir [options] [directory]
Command parameters
-m --mode = mode, when setting directory permissions to create the directory at the same time;
-p --parents if the parent directory does not exist, create a new directory;
-v --verbose each time you create a new directory will display information
- h --help help
Examples of commonly used commands
create an empty directory test1:
mkdir test1
Creating multiple directories recursively:
mkdir -p /test2/test22
Recursively create directories simultaneously display information created:
mkdir -pv /mnt/testa/testb/testc/
777 permission to create a directory:
mkdir -m 777 Test3
Current recursively create / text8 / text9 directory permissions to 777:
mkdir -pm 777 / mnt / test8 / test9
Create multiple parallel directories:
mkdir -pv /mnt/test8/x/m /mnt/test8/y = mkdir -pv /mnt/test8/{x/m,y}
Note: bracketed need
test8 directory tree structure created after the success:
----x
--m
----Y
Or execute: mkdir -pv / mnt / test2 / {a, d} _ {b, c}, generating a directory structure as follows: