Quick for “make listing”. Because the identify implies, this command is used to create a brand new listing when it does no longer exist. It is going to provide you with a warning when making a listing that already exists.

Normal syntax for mkdir command:

$ mkdir [OPTION...] [DIRECTORY...]
Show detailed knowledge of command
mkdir -v

Use the -v (verbose) approach to see what the mkdir command is doing within the background.

Instance: Printing details about what the command does when growing the NameDir listing

show command infoshow command info
Create a couple of directories
mkdir [dir1] [dir2] [dir3]

Create a couple of directories by way of specifying the listing names as command arguments, separated by way of areas.

Instance: Growing dir1, dir2 and dir3 directories underneath /Desktop/Command trail.

create multiple dircreate multiple dir
Set listing permissions
mkdir -m [permission] [dir]

Use the -m (-mode) choice with the mkdir command to create a listing with particular permissions.

Instance: Let’s create the DirName listing with read-only permission.

set directory permissionset directory permission
Create listing with SELinux context
mkdir -Z [dirname]

This feature is used to set default SELinux regulations for a selected listing at advent time.

Instance: Growing the ExampleDir listing with SELinux context.

create dir with SELinuxcreate dir with SELinux
Create multi-level directories
mkdir -p [directory_tree]

Use the -p choice with the mkdir command to create a whole listing construction.

Instance: Let’s create the listing tree dirname1/dirname2/dirname3, solely works if none of those directories exist already.

create multi-level dircreate multi-level dir

The publish How to Use the mkdir Command in Linux seemed first on Hongkiat.

WordPress Website Development

[ continue ]