无法向前搜索历史猛砸类似于用CTRL-R [英] Unable to forward search Bash history similarly as with CTRL-r
问题描述
我想我的搜索历史的bash类似于CTRL-R的,但前进方向。
I am trying to search my bash history similarly as with CTRL-r, but to forward direction.
这一直是我的痛苦,我只打一次,过于频繁CTRL-R,再次找到了previous命令。
It has been a pain for me, when I just hit once too often CTRL-r, to find the previous command again.
你怎么能期待你的搜索历史猛砸类似于反向搜索?
推荐答案
您可以向前搜索也是如此。从bash的信息手册 8.2.5在记录搜索命令:
You can search forward as well. From the bash info manual, "8.2.5 Searching for Commands in the History":
要在历史记录中向后搜索一个特定的字符串,键入 C-R
。
键入 C-S
向前搜索过的历史。
To search backward in the history for a particular string, type
C-r
. TypingC-s
searches forward through the history.
使用Ctrl-S的问题,不过是有时XON / XOFF流量控制碰撞(Konsole的举例)。搜索是一个readline的功能不过了,你应该能够将其绑定到其他一些重要的。更新:更简单,更好的就是通过运行禁用XON / XOFF
The problem with Ctrl-S however is that sometimes collides with XON/XOFF flow control (in Konsole for instance). The searching is a readline feature however, and you should be able to bind it to some other key. Update: Simpler and better is just to disable XON/XOFF by running
stty -ixon
这篇关于无法向前搜索历史猛砸类似于用CTRL-R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!