•Arnošt Havelka
Bash Manipulation: Cleanup Rehearsal
Practice file and directory cleanup patterns safely before using them in real workflows.
Start Interactive LessonBash Manipulation: Cleanup Rehearsal
Cleanup commands should be deliberate, not impulsive. This rehearsal focuses on removing known files and then removing an empty directory with separate commands.
Commands to Practice
rm temp1.txt temp2.txt
rmdir scratch
Expected Terminal Signal
Successful removals are silent. Verify state using:
ls
The removed files and directory should no longer appear.
Why This Matters
Deletion is irreversible in many contexts. Building a verify-first habit before and after cleanup operations prevents avoidable outages.
Common Mistakes
- Running
rmwith broad patterns before listing targets. - Using directory removal commands on non-empty directories.
- Treating silent output as optional to verify.
Practice Extension
Create a disposable target, then remove it:
touch a.tmp b.tmp
rm a.tmp b.tmp
This controlled repetition builds precision and confidence for larger cleanup tasks.
References
These Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.