Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 893 Bytes

mkdir.md

File metadata and controls

64 lines (47 loc) · 893 Bytes

mkdir

make directories


References

  • man mkdir

Quickstart

mkdir dir   # Make directory

Synopsis

mkdir [-pv] [-m mode] directory_name ...

Options

  • -m <mode> Set the file permission bits of the final created directory to the specified mode.
  • -p Create intermediate directories as required.
  • -v Verbose output

Usage

mkdir -m 600 root-user-only-dir

# check
$ ls -l
drw-------   2 icehe  staff    64B Sep 30 18:25 root-user-only-dir
mkdir -p path/to/some-dir

# check
$ tree path
path
└── to
    └── some-dir
2 directories, 0 files
mkdir -p foo/bar/{app/boy/{cat,dog},egg,fool}

# check
$ tree foo
foo
└── bar
    ├── apple
    │   └── boy
    │       ├── cat
    │       └── dog
    ├── egg
    └── fool
7 directories, 0 files