In a terminal the Bash history can be searched easily with Ctrl+r. But what if I cannot find what I am looking for? I am stuck in the middle of my history. What if a want to search again from the beginning?
Is there another shortcut to reset the history search?
There is Meta + >, which is bound to end-of-history
and useful if you're in the middle of your history. The meta key is usually the Alt key.
If you see that your incremental history search isn't successful, you can use Ctrl + G, which is bound to abort
and restores the previous line and history position.
Check the manual for more commands like these.
This may be a somewhat indirect answer, but I usually use Ctrl+c to exit the history search. This cancels your entire line entry, leaving you on a fresh prompt with no input on the line, and back at the end of the history list.
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