Created
May 25, 2026 20:43
-
-
Save copyleftdev/7dd3664677e84bf1b81a03b2df2c52c0 to your computer and use it in GitHub Desktop.
tee — split stdout to terminal and file simultaneously
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # tee — write to stdout AND a file at the same time | |
| <command> | tee output.log # overwrite | |
| <command> | tee -a output.log # append | |
| <command> | tee file1 file2 # fan out to multiple files | |
| # The AI workflow pattern — log + timestamps + live view in one pipeline: | |
| agent-command 2>&1 | ts '[%H:%M:%S]' | tee run-$(date +%Y%m%d-%H%M%S).log | |
| # Process and preserve the original simultaneously: | |
| cat data.jsonl \ | |
| | tee data-raw-copy.jsonl \ | |
| | python3 transform.py \ | |
| | tee data-transformed.jsonl \ | |
| | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment