How to use the mkdir command in Linux
Created
mkdir command in Linux allows the user to create directories (also referred to as folders in some operating systems ). This command can create multiple directories at once as well as set the permissions for the directories.
New Directory
mkdir newdir
Help
mkdir --help
info mkdir
man mkdir
version information
mkdir --version
mkdir (GNU coreutils) 8.22
How to Create Parent Directories
make parent
mkdir -p /data/go
print a message
mkdir -v -p /data/go
mkdir: created directory ‘folder’
The syntax for the mkdir command is as follows:
Usage:
mkdir [OPTION]... DIRECTORY...
OPTIONS:
-m, --mode=MODEset file mode (as in chmod), not a=rwx - umask-p, --parentsno error if existing, make parent directories as needed-v, --verboseprint a message for each created directory-Zset SELinux security context of each created directory to the default type--context[=CTX]like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX--helpdisplay this help and exit--versionoutput version information and exit