Copy a file
Duplicate files with cp
⏱ Est. ~4 min
01 · Read
Sometimes you want a copy of a file — for a backup, or as a starting point for a new version. The cp command makes a duplicate.
💡 Picture thisLike photocopying a document — you end up with two identical copies in two different places.
Key points
- cp is short for copy
- Syntax: cp source destination
- The original file is left untouched
02 · Terminal exercise
Sometimes you want to duplicate a file — keep the original, make a copy.
(This section is interactive — please enable JavaScript.)
03 · Terminal exercise
You can rename while you copy.
(This section is interactive — please enable JavaScript.)
04 · Terminal exercise
Confirm both copies are in the backup folder.
(This section is interactive — please enable JavaScript.)
05 · Fill in the blank
To copy notes.txt into a new file called backup.txt, you'd type: ___ notes.txt backup.txt
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.