1

I love to know how long my CLI commands take so I often preceded them with time - sometimes I forget. Also I don't keep a record of long running commands so can't see if they vary over time.

My bash history looks like this:

 1428  05/23/19 22:04:14 git status
 1429  05/23/19 22:04:17 git add .
 1430  05/23/19 22:04:19 git status

I've added the date/time by putting export HISTTIMEFORMAT="%m/%d/%y %T " in my bashrc file.

Question: Is there a way to automatically record the time all all bash commands and insert that to the bash history? So for example my history would look like:

 1428  05/23/19 22:04:14 (0.015) git status
 1429  05/23/19 22:04:17 (0.035) git add .
 1430  05/23/19 22:04:19 (0.016) git status

My shell is Terminator on Ubuntu so if there's a feature of Terminator above and beyond bash then that works too.

0

0

Browse other questions tagged .