ubuntu terminal search command

C++
Ctrl + R <command_part> 
# e.g CTRL + R mv 
# will search for recent usage of 'mv' commmand
# Keep pressing CTRL + R to move back to your histroy 
# or CTRL + S to move forward> grep "the_search" ~/.bash_history

--Don't forget the -i flag if you need case insensitive search.
Source

Also in C++: