Bash Ctrl+R 搜索历史命令可以向前搜索吗?

2018-03-23 15:07:15 +08:00
 yuzenan888

经常 Ctrl+R 按多了一下,然后就回不来了。

man 文档说 Ctrl+S 可以向前搜索,但是我怎么试都不行。

reverse-search-history (C-r)
       Search backward starting at the current line and moving `up' through the history as necessary.  This is an incremental search.
forward-search-history (C-s)
       Search forward starting at the current line and moving `down' through the history as necessary.  This is an incremental search.
3514 次点击
所在节点    Linux
3 条回复
YORYOR
2018-03-23 16:51:49 +08:00
亲测了一下 C-r 过了 直接 C-s 可以
不过我是 zshell
MyPassWordis
2018-03-23 17:50:04 +08:00
stty -ixon
关掉流控制
yuzenan888
2018-03-23 19:32:28 +08:00
@MyPassWordis 谢谢,竟然好了!我是用 macOS 自带的终端。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/440787

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX