With CTRL + R you can search in previous commands (in the terminal of Ubuntu). However, it always seems to display the last occurrence of the search term. Is there any way to browse through all results?

link|improve this question

50% accept rate
feedback

migrated from stackoverflow.com Mar 19 '11 at 18:59

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 4 down vote accepted

After you type the few characters to search, you can press CTRL+R again to browse through the history that matches what you typed.

It will be limited to the history size though.

link|improve this answer
feedback

You just need to press CTRL-R again.

link|improve this answer
feedback

If you just want to see all matching history lines at once, try fc -ln | grep.

mress:10077 Z$ fc -ln -100 | grep \^cd 
cd /Volumes/Development/android-sdk-mac_x86
cd ~/Downloads/MagicTrackpad.pkg
cd Resources
cd English.lproj
cd ../..
cd MagicTrackpadMultiTouchUpdate1.0.pkg
cd ..
cd 

(-100 means "the last 100 commands"; the default is 20, or you can specify a range.)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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