In Terminal when we press Ctrl+R, we can search through the command history. However, if we do not find what we want, how can we go back to the directory prompt, and not have any of the search results displayed?
In Terminal when we press Ctrl+R, we can search through the command history. However, if we do not find what we want, how can we go back to the directory prompt, and not have any of the search results displayed?
You can use the combination Ctrl+G.
Excerpt of
man readline
:Exit from history search with ESC
You can use the Esc key or Ctrl+C. Both will get you out of the search command.
The difference is that Esc will keep the last searched command, but Ctrl+C will exit the command completely.