Low Orbit Flux Logo 2 F

Linux Command - mkdir

mkdir - make directories



mkdir dir1

mkdir dir1/dir2      # create subdir if dir1 exists  

mkdir -p dir1/dir2   # create dir and sub dir

mkdir -p /var/www/html  # using an absolute path

If a parnet dir doesn’t exist you will need -p to avoid an error.

-p create parent dirs as needed
-m set the mode ex: 755 ( not a=rwx )
-v verbose
-Z use default SELinux security context
–context=[CTX] SELinux or SMACK context