Simple command:
#history
If you wish to view the history one page at a time, you can use the command below. Now, you can simply use the spacebar to view one page at a time or use the down arrow to view one line at a time:
#history | less
To view just the last ten commands, you can use the following:
#history | tail
To view the last 25 commands, just use the following:
#history 25
Another way to search history is with the following command (just be sure to replace “searchterm”):
#history | grep -i searchterm | less