Piping to stdout and file simultaneously

Just another note to self here:

./[program] [arguments] | tee [filename.txt]

Run program with arguments, use pipe “|” and the program named “tee” to output do both stdout and a particular file. Great for logging terminal programs.

Flags:

  • -a Appends the output to the end of File instead of writing over it.
  • -i Ignores interrupts.

Since it’s a GNU-core utility, “man tee” gives a manual of the program.