tee Command Generator
Generate tee commands to copy stdin to stdout and files
Getting Started with tee
## What is tee?
`tee` reads from standard input and writes to both standard output **and** one or more files. It's the standard way to capture pipeline output to a file while still seeing it on screen, or to fan out a stream to multiple destinations.
## How to Use
1. **Set Options** (optional): `-a` to append instead of overwriting. 2. **Specify File**: Enter the output file (or files, by listing them manually in your shell). 3. **Copy & Run**: Pipe a command's output into the generated `tee` command.
Common Patterns
### Append with `-a` Add to a log instead of overwriting it:
``` echo "$(date) start" | tee -a run.log ```
### Capture while viewing Show a long build log on screen **and** save it:
``` make 2>&1 | tee build.log ```
### Fan out Tee to multiple files at once (manually add file arguments):
``` cat data.txt | tee a.txt b.txt c.txt ```
### Combined with sudo Write to a root-owned file:
``` echo "config" | sudo tee /etc/myapp.conf ```
▶How do I append instead of overwrite?
▶Can I write to multiple files?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee