Name
mkdir
Synopsis
mkdir [options]directories
Create one or more directories. You must have write permission in the parent directory in order to create a directory. See also rmdir. The default mode of the new directory is 0777, modified by the system or user’s umask.
Options
- -m mode, --mode mode
Set the access mode for new directories. See chmod for an explanation of acceptable formats for mode.
- -p, --parents
Create intervening parent directories if they don’t exist.
- -v, --verbose
Print a message for each directory created.
- --help
Print help message and then exit.
- --version
Print version number and then exit.
- -Z context, --context=context
Set security context in SELinux.
Examples
Create a read-only directory named personal:
mkdir -m 444 personalThe following sequence:
mkdir work; cd work mkdir junk; cd junk mkdir questions; cd ../..
can be accomplished by typing this:
mkdir -p work/junk/questionsBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access