Syntax of tee command

tee [option] [file]

tee command options

To get help with tee command and display all options available for tee command use tee --help command.

tee --help

tee --help

tee --version

tee --version

tee command usage with examples

free | tee memory.txt

Here I am using tee command pipe with free command and output of free command will be copied into memory.txt file.

tee command

By default, tee command overwrites the file. Using tee command with -a option do not overwrite the file but append it to the given file.

I am using tee command pipe with wc command. wc command is used for count number of lines, words and bytes count of a file. Here wc memory.txt | tee -a memory.txt display

wc memory.txt | tee -a memory.txt

tee -a command in linux

date | tee -a date.txt memory.txt

tee -a pipe multiple file

free | tee date.txt

tee command without append

echo learning tee command with programbr | tee -a date.txt

echo pipe with tee

Sharing is Caring
Scroll to Top