How do I get the timestamp of each command line in the terminal history?

I would like to know how long it took for the command I entered into my terminal. It would be great to get a timestamp of every command in my story. Let me know if you need more information to be able to answer this question. Thank.

EDIT: I am using bash terminal.

+3


source to share


2 answers


Assuming you are using command line

HISTTIMEFORMAT="%d/%m/%y %T "

      

then



history

      

http://www.cyberciti.biz/faq/unix-linux-bash-history-display-date-time/

+11


source


I don't think I know how to show the duration, but you can view the time the command was run by setting the HISTTIMEFORMAT variable.

export HISTTIMEFORMAT='%F %T '

      

Then name your "story"

history

      



If you only want to see the last 10 teams

history | tail

      

Hope this help :)

+2


source







All Articles