mkdir - make directories
mkdir [-p] [-m MODE] directory...
Options you will use
-p, --parents- Create parent directories as needed; no error if the directory already exists.
-m MODE, --mode=MODE- Set the permission bits of the new directory (umask is not applied).
-v, --verbose- Print a message for each created directory.
Examples
$ mkdir -p ~/oncall-lab/labs/1a-linux/{systemd,processes,bash}brace expansion makes all three in one go
Gotchas
- Brace expansion happens in the SHELL before mkdir runs - it never sees the braces. A relative path here is relative to your CURRENT directory, which is how you end up with a second labs/ folder.
Taught in
- 1.5 Making things
- 1.7 Driving the shell: exit codes, chaining, redirection
- 4.7 r and x mean something else on a directory
- 4.9 setuid, setgid, sticky and umask
- 4.15 find: the expression language
- 9.17 Certificates with openssl, and the JVM truststore
- 11.22 Volumes, bind mounts, tmpfs, and the UID problem
- 21.29 Python for operations: the subset, venv, and why never system pip
Try mkdir in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.