クエスト 22Expansionist
+220 XP
Brace Expansion & Safe Directory Removal ({} & rmdir)
このクエストの対話型ターミナルを起動する→インストール不要 • ブラウザ上で完全動作
概念と概要
Bash brace expansion {} is a powerful productivity feature that generates arbitrary string combinations before commands run, eliminating repetitive typing:
- Comma-separated lists: mkdir -p app/{src,bin,logs} expands to app/src, app/bin, and app/logs in a single command.
- Numeric or alphabetic ranges: touch file_{1..3}.txt expands to file_1.txt, file_2.txt, and file_3.txt.
When deleting folders, rm -r deletes everything recursively without safety checks. By contrast, rmdir provides a strict safety guarantee: it only removes directories that are completely empty, preventing accidental loss of files.
ミッションの手順
Practice brace expansion and safe directory removal!
1. Run
2. Run
3. Safely delete the empty folder
1. Run
mkdir -p app/{src,bin,logs} to build multiple application directories at once.2. Run
touch file_{1..3}.txt to create three numbered files in one command.3. Safely delete the empty folder
temp_empty using rmdir temp_empty.コマンド構文リファレンス
| Command / Syntax | Description |
|---|---|
mkdir -p app/{src,bin,logs} | Create multiple directories using brace expansion |
touch file_{1..3}.txt | Create sequential files using range expansion |
rmdir temp_empty | Safely remove an empty directory |
検証目標
- ○Create directories app/src, app/bin, and app/logs using brace expansion
- ○Create file_1.txt, file_2.txt, and file_3.txt using brace expansion
- ○Safely remove directory temp_empty using rmdir