Mission 30 of 30 · Milestone
Grand Finale and Cleanup
Build, inspect, back up, run, and safely remove a complete mini project.
Build a mini project that reviews navigation, files, scripts, archives, grep, find, permissions, and cleanup.
Practice inside
~/linux-practice. Check your setup before you begin.
Prerequisite: Customizing Your Shell Safely
.
What you’ll practice
- Complete an integrated project
- Create a backup
- Clean up safely
The mental model
- A good Linux workflow creates, verifies, backs up, and then removes only intended files.
- Cleanup is safe when the path is explicit and checked.
Try it in your terminal
Create final project
Safe in practice folderCreates a complete mini project.
Run from ~/linux-practice
cd ~/linux-practice
mkdir -p final_project/{src,docs,bin} backups
cd final_project
echo 'main function' > src/main.c
echo '# README' > docs/README.md
cat << 'EOF' > bin/script.sh
#!/usr/bin/env bash
echo 'Processing...'
for f in src/*; do
echo "Found: $f"
wc -l "$f"
done
EOF
chmod +x bin/script.sh Review skills
Safe in practice folderUses archive, find, grep, head, xargs, du, and script execution.
Run from ~/linux-practice/final_project
cd ~/linux-practice/final_project
tar -czvf ../backups/final-project-v1.tgz src docs bin
tar -tzf ../backups/final-project-v1.tgz
find . -name '*.sh' -exec ls -lh {} \;
grep -r 'function' .
head -2 docs/README.md
find . -type f \( -name '*.c' -o -name '*.sh' \) -print0 | xargs -0 wc -l
du -sh .
./bin/script.sh Remove final project only
CautionDeletes only final_project inside the sandbox.
Run from ~/linux-practice
cd ~/linux-practice
rm -rf final_project Put it into practice
- Run the final project from start to finish.
- Explain each command in your own words before cleanup.
Check your result
The project passes verification and its backup survives cleanup.
Milestone challenge
Complete the final mini project without following the lab line by line: build it, verify it, archive it outside the project, test the archive, remove only the project, and prove the backup survived.
Common mistakes
- You `cd` somewhere, type `rm -rf *`, and realize you're in your home directory instead of the project folder. Always run `pwd` before any destructive command. The path you see in your prompt is the path `rm` will use. Verify before you delete.
- Never store a recovery archive inside the directory it protects. Verify the external archive with `tar -tzf backups/final-project-v1.tgz` before removing the project.
Check your understanding
Explain these in your own words. If you’re unsure, revisit the examples before moving on.
- Which command created the backup?
- What should you check before running rm -rf?
Clean up this exercise
Remove the whole practice folder
CautionDeletes only the course sandbox if you kept all practice work inside ~/linux-practice. Optional admin actions such as apt installs are not undone by this.
Run from home directory
cd ~ && rm -rf ~/linux-practice Expected result
~/linux-practice no longer exists
Your practice, your pace
Loading saved progress…