This will redirect STDOUT and STDERR to the same file:
some_command 2>&1 | tee file.log
Example
$ touch foo; ls foo asfdsafsadf 2>&1 | tee file.log ls: asfdsafsadf: No such file or directory foo $ cat file.log ls: asfdsafsadf: No such file or directory foo
Siegex
source share