The history command prints the last commands executed.
history [-r] [number]The command will print out the last number commands typed by the user, or all the commands saved if number is not given. The number of commands saved is determined by the value of the history variable. If the -r flag is given, the list is printed in reverse order.