Save terminal output to a file (stdout, stderr, tee) — by Seth on Ask Ubuntu
A clear reference to shell redirection: > overwrites a file, >> appends, 2> captures errors, and tee shows output on screen while also writing it to a file.
Quick steps
- Overwrite: command > file.txt
- Append: command >> file.txt
- Show and save: command | tee file.txt
Paraphrased from the source. Menus can differ by version, so check the original for full details.
Source: Save terminal output to a file (stdout, stderr, tee) by Seth on Ask Ubuntu. Licence: CC BY-SA (Stack Exchange; version depends on post date).
- Source reviewed
- 2026-11-02
- Link checked
- Not yet
- Tested hands-on
- Not by Oddbyte.Me