The tee
command splits the output of a program, so that it can be both
displayed and saved in a file. This command is usually used when you
want the output of the program to be both stored and displayed on the
terminal.
For example, if we want to display the output of the ls command on the terminal and store it in a file called output.txt, we can use the following command:
For example, if we want to display the output of the ls command on the terminal and store it in a file called output.txt, we can use the following command:
NOTE – by default, tee overwrites existing files. If you want to append data to the existing files, pass the -a option to tee.
Post a Comment