How can I get the timestamp of each command line in my terminal history?
Assuming you are using command prompt
HISTTIMEFORMAT="%d/%m/%y %T "
then
history
http://www.cyberciti.biz/faq/unix-linux-bash-history-display-date-time/
I don't think I know how to show the duration, but you can view the time you ran the command by setting the HISTTIMEFORMAT variable.
export HISTTIMEFORMAT='%F %T '
Then call your "history"
history
If you only want to see last 10 commands
history | tail
Hope this help :)