History with last n commands
The history command return the last n executed command on the terminal/command line prompt.
$ history -10
1036 ./exercise
1037 clang exercise.cpp -o exercise
1038 ./exercise
1039 g++ -version
1040 g++ --version
1041 gcc --version
1042 /usr/bin/gcc --version
1043 history 1 | grep g++
1044 history | grep g++
1045 clear
$