Linux mkdir command

mkdir is used to create directories(folders).


mkdir [Directory_name]


$mkdir k2schools


Option Description
-m set file mode (as in chmod), not a=rwx – umask
-p no error if existing, make parent directories as needed
-v print a message for each created directory
-z set the SELinux security context of each created directory to CTX

More Examples:

To create multiple directories using mkdir

mkdir class1 class2 class3 class4 -v

Linux mkdir command
To create nested directories

mkdir -p class1/linux/shellscripting -v

Linux mkdir command1
To get the list of files/directories


To get the list of files/directories with sub directories/files

ls -R

Linux mkdir command2

Powered by k2schools
Skip to toolbar