Make nested folders in one go with mkdir -p
mkdir a/b/c fails if a doesn't exist yet. Add -p and it builds the whole path, no errors.
- Type
mkdir -pand the full path you want, likemkdir -p notes/2026/march. - Press Enter: every missing parent folder is created on the way.
- Run it again:
-pdoesn't complain if the folders already exist. - Add
-vto print each folder as it's made.
Tip: Combine it with braces to make sibling folders at once: mkdir -p site/{css,js,img}.
Try it now: Run
mkdir -pv /tmp/crumbs/a/b/c and watch it make all four folders.Next crumbs
- 💻 Terminal & gitJump back with cd -Toggle between your last two directories, like Alt+Tab for folders.
- 💻 Terminal & gitReuse the last argument of your previous commandJust made a folder and now want to cd into it? Don't retype the path. One key pair pastes it back.
- 💻 Terminal & gitSearch your shell history with Ctrl+RStop pressing the up arrow 40 times. Type any part of an old command and it appears.