Text and processing
The tee command
Shows the output on screen and saves it to a file at the same time. It is the 'T' of a pipeline: it writes to two places.
Syntax
comando | tee archivoMost useful options
-aAppends instead of overwritingCopy-ready examples
$ echo hola | tee nota.txtSee and save at onceYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- Without -a, tee overwrites the file just like the > operator.
FAQ
Why use it if I already have >?
So you do not lose the on-screen output: with > you see nothing.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course