Skip to Content
gnux

-m, --mode

Set file MODE (as in chmod), not a=rwx - umask.

An option of mkdirx.

Usage

mkdirx -m MODE DIRECTORY...
mkdirx --mode=MODE DIRECTORY...

Details

ShortLongValueDefaultMeaning
-m--modeMODEset file MODE (as in chmod), not a=rwx - umask

Examples

Create a directory only its owner can enter

mkdirx -m 700 ~/.secrets

Use a symbolic mode

mkdirx -m u=rwx,go=rx shared

Grant everything except write for others, using a symbolic mode with a removal

mkdirx -m a=rwx,o-w drop

Create a world-writable scratch directory with the sticky bit set

mkdirx -m 1777 scratch

Create missing parents but give only the last directory an explicit mode

mkdirx -p -m 755 www/public

Help in the terminal

gnux help mkdirx --mode

On this page