Append to a file
Add to the end with >>
⏱ Est. ~5 min
01 · Read
Sometimes you don't want to replace the whole file — you want to add to it. >> appends content to the end of a file without wiping what's already there.
💡 Picture thisIf > is wiping the whiteboard, >> is writing on the next empty line — everything above stays untouched.
Key points
- >> appends content to the end of a file
- It never erases the original content
- Like >, it creates the file if it doesn't exist
02 · Terminal exercise
Let's start by looking at a file that already has contents.
(This section is interactive — please enable JavaScript.)
03 · Terminal exercise
Now add an item without erasing what's there. Use >> instead of >.
(This section is interactive — please enable JavaScript.)
04 · Terminal exercise
Confirm the original content is still there.
(This section is interactive — please enable JavaScript.)
05 · Terminal exercise
Add another item for practice.
(This section is interactive — please enable JavaScript.)
06 · Fill in the blank
To add text to the end of a file without erasing what's there, use the ___ symbol.
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.