How to get last N commands from history?
I found it!
history [n]
An argument of n lists only the last n lines.
$ echo "hello
how are you"
$ history 2
1060 echo "hello
how are you"
1061 history 2
You could also use negative numbers, like :
history -1
Or use a range (last 10):
history -1 -11