Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In reverse-i-search (Ctrl+R ) ,Any method to switch between similar commands in history

I think an example will be good to understand my question.

... scp file1 [email protected]:/home/user1/linuxfiles/samplecode/important ... ... scp file1 [email protected]:/home/user1/linuxfiles/samplecode/important/tested ... ... 

Assume that is the order of commands in history. If I am doing Ctrl+R and type scp it will show the last executed scp command ( ie the line ending with 'tested') .

But I want to locate the scp command ending with 'important'. So is there any way in this reverse-i-search to view all commands starting with scp, to choose the appropriate one?

like image 233
Arun Avatar asked Jan 09 '13 09:01

Arun


People also ask

What command is used to cycle through matches in reverse search mode?

Press ctrl + r again to navigate through earlier entries in your history that match your search term.

What is Reverse I search?

Use reverse-i-search to find past commands Besides using tab-autocompleting aggressively, I also use reverse-i-search all the time to search my command history. Activate reverse-i-search using Ctrl+r and then type in a query to find matches. Hit Ctrl+r again to find the next match.

What does Ctrl R do in Linux?

Ctrl+R – starts a reverse search, through the bash history, simply type characters that should be unique to the command you want to find in the history. Ctrl+S – launches a forward search, through the bash history.


1 Answers

Keep pressing Ctrl-R and it will traverse your history.

like image 110
jgr Avatar answered Sep 26 '22 18:09

jgr