tee¶
Copy standard input to files and stdout.
Synopsis¶
Description¶
Read from standard input and write to standard output and files simultaneously. Useful for capturing output while still displaying it.
Flags¶
| Flag | Short | Description | Default |
|---|---|---|---|
--append |
-a |
Append to files instead of overwriting | false |
--ignore-interrupts |
-i |
Ignore SIGINT signals | false |
--silent |
-s |
Silent mode: only write to files | false |
Examples¶
Write to file and stdout:
Append to file:
Write to multiple files:
Silent mode (no stdout):
In a pipeline:
Ignore interrupts:
Use Cases¶
- Logging command output while watching it
- Duplicating data to multiple destinations
- Creating audit trails of command output