Save Output to a File
Sometimes you don't want to copy output — you want to save it to a file. Terminal has special symbols for this.
The > Symbol: Create or Overwrite
The > symbol sends output to a file instead of showing it on screen:
Save a directory listing to a file:
ls -la > filelist.txt
Check the contents:
cat filelist.txt
Careful! Using > will overwrite the file if it already exists. No warning, no undo.
The >> Symbol: Append
If you want to add to a file instead of replacing it, use double arrows:
Add the date to your file:
date >> filelist.txt
Check — it's at the end now:
cat filelist.txt
Real Uses
Quick note-taking from Terminal
Save your command history for reference
Key Takeaway
> saves output to a file (overwrites). >> appends to a file. Both are essential for logging and saving data.