[colug-432] Search Command History

Rob Funk rfunk at funknet.net
Mon Feb 10 16:45:51 EST 2014


tom wrote:
> Is there a way to search command history for a particular item? For 
> example I would like to see every instance I used apt-get without having 
> to arrow up or down thru the entire history.

At least two ways:
Try control-R, then start typing a piece of the previous command. When
you see the one you want, you can hit enter to re-run, or a cursor
movement (e.g. control-A for beginning-of line, control-E for
end-of-line) to edit before running it. Or control-R again to keep
searching.

Alternately:
  history | grep apt-get




More information about the colug-432 mailing list