The tee
command takes the format of:
tee [ -a ] [ File ]
The following command only displays output on the screen (stdout)
pwd
will display output like this: (matching your selected username)
/home/pulsys
The same command directs the output to a file
pwd > file
cat file
you will see output like this: (matching your selected username)
/home/pulsys
By using a pipe to tee
we can display on stdout AND direct to a file
pwd | tee file.txt
you will see output like this: (matching your selected username)
/home/pulsys