ubuntu search for command used

C++
> grep "the_search" ~/.bash_history

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

Also in C++: