how to us mkdir command with its examples

  • About mkdir: To make directories
  • It comes from “coreutils-8.4” package.
  • Configuration Files:
  • Path: /bin/mkdir

Examples:

1. To make the directory

$ mkdir mike

 2. To set file mode while making the directory

$ mkdir -m
$ mkdir –mode=MODE

 3. To make parent directories if needed

$ mkdir -p /support/mike
$ mkdir –parents /support/mike

4. To set to verbose mode

$ mkdir -v
$ mkdir –verbose

 5. To set the SELinux security context of each created directory to CTX

$ mkdir -Z
$ mkdir –context=CTX

6. To get the help

$ mkdir –help

 7. To output the version information

$ mkdir –version

 

Leave a Reply

Your email address will not be published. Required fields are marked *