Copying & Moving Files
Concept & Overview
Imagine reorganizing your room: sometimes you want to make a photocopy of a document to keep in another drawer, and other times you just want to grab a folder and slide it into a new shelf or change its label. We do this in Linux with simple commands:
- cp creates an identical duplicate of a file in a new location.
- mv moves a file to a new folder, or renames the file if you keep it in the same folder (e.g., mv old.txt new.txt).
status.txt named status_backup.txt using cp status.txt status_backup.txt. Next, rename the original status.txt to system.log using mv status.txt system.log.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
cp status.txt status_backup.txt | Create a backup copy of status.txt |
mv status.txt system.log | Rename status.txt to system.log |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Use the "cp" command to create status_backup.txt
- ○Use the "mv" command to rename status.txt to system.log
- ○Verify status_backup.txt and system.log exist with correct contents
Ready to complete Quest 19?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.