Back to Blog
Arnošt Havelka

Bash Manipulation: Copy and Move Drill

Use cp and mv as a safe two-step flow for duplication, review, and final naming.

Start Interactive Lesson
Bash Manipulation: Copy and Move Drill

Bash 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

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.

Up Next

Bash Manipulation: Cleanup Rehearsal

Practice file and directory cleanup patterns safely before using them in real workflows.