Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I search the terminal command history by pressing Ctrlr but what if:

This is an old command

This is an | less -S older command

I press Ctrlr and then I type "this is an" and the old command commes up but not the older. How can I search all the "this is an" commands? Is it possible to pipe all similar commands to grep or something?

If I set -o vi, how do I undo it?

share|improve this question
3  
to undo vi-style line editing just set -o emacs since there only exists emacs and vi line editing mode. –  user1146332 Sep 11 '12 at 12:34
add comment

2 Answers 2

up vote 6 down vote accepted

To search for a command in the history press ctrl+r multiple times ;-)

You can also grep through the history using:

 history | grep YOUR_STRING
share|improve this answer
add comment

If I understand correctly and you want to search for older entries, just press ctrl+r again.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.