Questions tagged [tee]

In computing, tee is a command in various command-line interpreters (shells) such as Unix shells, 4DOS/4NT and Windows PowerShell, which displays or pipes the output of a command and copies it into a file or a variable. It is primarily used in conjunction with pipes and filters.

In computing, tee is a command in various command-line interpreters (shells) such as Unix shells, 4DOS/4NT and Windows PowerShell, which displays or pipes the output of a command and copies it into a file or a variable. It is primarily used in conjunction with pipes and filters.

enter image description here

tee is normally used to split the output of a program so that it can be seen on the display and also be saved in a file. The command can also be used to capture intermediate output before the data is altered by another command or program. The tee command reads standard input, then writes its content to standard output and simultaneously copies it into the specified file(s) or variables. The syntax differs depending on the command's implementation.

Examples on wikipedia.

19 questions
0
votes
1 answer

Where does cron store the real-time stderr logs?

I've got a cron job configured to run a command like some-command 2>&1 >/dev/null | tee -a /tmp/some-command.STDERR.$(date +\%Y-\%m-\%d.\%H.\%M) I've also got a tmpreaper cron job that tidies up older logs. Every now and then a process goes haywire…
Chris Conway
  • 111
  • 3
0
votes
2 answers

How to output a stdout both to a process and the shell screen

Do someone knows a way to send the stdout of a command both to another command and display it in the shell screen? Note: without using files. An example (in this case I use wc -l to make it simple ) ~> echo "test" | wc -l 1 but I need to…
Barooh
  • 3
  • 1
0
votes
0 answers

How to ensure output from "tee" is shown when used in a script run under systemd

I have a script that I'm running under systemd which has some debug logs that I'd like to send to both stdout (which should end up in the system journal, viewable with journalctl) as well as to a log file on my filesystem. Typically I'd reach for…
mgalgs
  • 345
  • 2
  • 9
0
votes
1 answer

Linux shell: Pipe stderr and stdout to one file AND to individual files at the same time (using tee?)

I would like to form a pipe-stream that captures stdout to one file and stderr to another file AND both in a third file (so also the complete terminal output is in one file) somehow like this: process ----+-- --- + --- stdlog.txt …
1
2