Command Search in Linux

Friday, February 6, 2009

Command Search in Linux

CTRL + R is one of the keys the common Unix CLI user uses the most. We can search within the previous commands we have entered into the shell and execute them too easily. Yeah, history | grep will also do.

I use CTRL + R a lot. Till today, I didn't knew how to select a particular command if the search string matches multiple commands. What I do is go on typing until I get to the command I need.

Today Balu told me how to select. Once you press CTRL + R, the search prompt will come up. As you go on typing the commands get matched and displayed. Pressing CTRL + R again will show next command matching the search string. Isn't it cool?

PS: CTRL + R stands for reverse search. CTRL + S works in the opposite direction.

See also... » Ubuntu Crashed Twice

ATOzTOA : Latest Headlines


Anonymous said...

ya, CTRL R is useful.

One more related trick:

Post a Comment