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?
Press ctrl + r again to navigate through earlier entries in your history that match your search term.
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.
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.
Keep pressing Ctrl-R and it will traverse your history.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With