Bulk Create Paths With Brace Expansion
Generate many names at once with {a,b} lists and {1..5} ranges.
Run mkdir -p project/{src,tests,docs} to create three directories in one command.
01Command
Command
$ mkdir -p project/{src,tests,docs} && touch project/src/file{1..5}.txt02What it does
Brace expansion expands patterns before the command runs, so a single line can create dozens of files or directories. It makes repository scaffolding and fixture setup fast and consistent, and it is unavailable through file-manager dialogs.
03Risk
!Warning: Expansion happens before globbing; if a match is wrong, the command receives the literal brace pattern.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- bash.1.en.html manual pageEvidence: The bash manual page documents brace expansion.
Last verified: 2026-10-13 · Category: Developer