重置bash历史记录搜索位置 [英] Reset bash history search position
问题描述
在终端中,可以使用 Ctrl + r 轻松搜索Bash历史记录.但是,如果我找不到想要的东西怎么办?我被困在历史的中间.如果想从头开始再次搜索怎么办?
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?
推荐答案
有 Meta + > ,绑定到end-of-history
,如果您在您的历史中间.元密钥通常是 Alt 密钥.
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.
如果您发现增量历史记录搜索不成功,则可以使用 Ctrl + G ,该绑定到abort
并恢复了上一行,并且历史位置.
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.
这篇关于重置bash历史记录搜索位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!