Categories
Linux Tutorial Series

Linux Tutorial Series – 68 – The tee command

Here is the video version, if you prefer it:

The tee command is used to redirect standard output to both standard output and one or more files. (Shotts, 2019)⁠ Here is an example of its usage:

mislav@mislavovo-racunalo:~/Documents$ ls | tee ls.txt | grep test

test.txt

mislav@mislavovo-racunalo:~/Documents$ cat ls.txt

001_002.pdf

Accounti

AGI safety podcasti

...

I never used it, but it is very useful to check the output intermediary steps in long pipes.

Hope you learned something useful!

References

Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Pages 89-90