Bash Manipulation: Copy and Move Drill
Use cp and mv as a safe two-step flow for duplication, review, and final naming.
Start Interactive LessonBash Manipulation: Copy and Move Drill
This lesson reinforces a production-safe sequence: copy first, verify, then move or rename to final state. It reduces risk during refactors and incident remediation.
Commands to Practice
cp report.txt backup.txt
mv backup.txt archive.txt
Expected Terminal Signal
Both commands usually complete silently on success. Confirm with:
ls
You should see report.txt and archive.txt (with backup.txt removed after move).
Why This Matters
Copy-before-move protects source material while you validate downstream steps. This is especially valuable in release prep and log curation pipelines.
Common Mistakes
- Moving directly without creating a recovery copy.
- Mixing source and destination order.
- Forgetting to inspect resulting filenames.
Practice Extension
Try the full loop:
cp runbook.md runbook.bak
mv runbook.bak runbook-archive.md
ls
Repeat until source/destination ordering becomes instant and error-free.
References
These Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.