The time(1)
command allows you to time any command, by passing it as arguments to time
.
I know it's possible to redirect stderr
and stdout
to a file via 2>&1
, and there's also tee(1)
which allows one to copy its input to both the screen and a file. However, I do not know how to add timestamps to logs.
Is there a tool to redirect stderr
and stdout
to a file, AND append timestamps to it for logging purposes?
logger
and get a standard entry (with timestamp before the log entry)? – Anthon Dec 17 '16 at 08:18