mkdir command in linux



mkdir command: This command is use to crate the directory / folder.
Command syntax:
Command option argument

Help command
# mkdir --help

Examples:
Create a directory
# mkdir dir1

Create multiple directory
# mkdir dir2 dir3

Create directory under /root directory
# mkdir /root/dir4

Create multiple directory along with parent directory  
Use -p option to create parent directory
#  mkdir -p  dir5/dir6/dir7

Create multiple directory inside directory dir6
# mkdir dir5/dir6/{data1,data2,data3}

list created directory
# cd dir5/dir6
# ls
data1  data2  data3  dir7

Create directory with permission
# mkdir -m 777 data4

List permission of directory
# ls -ld data4
drwxrwxrwx 2 root root 6 Aug 13 16:57 data4
Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

2 comments: