Most of the things I run in the terminal take a long time to compute and I would like to have bash output a time report at the end of every command entered into the terminal. Is there something I can put into my bashrc to do this?
Example:
$ find / -ls
<find / -ls return info>
start time = 10:21:54 | end time = 10:31:34 | time lapsed = 00:10:20
$
or
$ make all
<make all return info>
start time = 10:21:54 | end time = 10:31:34 | time lapsed = 00:10:20
It would be nice to be able to add a list of exceptions for commands like cd, but it wouldn't really bother me.
time
will give you most of what you need but I'm not sure how to add it automatically. – terdon Nov 19 '13 at 17:41trap 'date' DEBUG
. – Joseph R. Nov 19 '13 at 18:14