How to browse through probable results of history in Unix shell using CTRL-R?
I have a shell script which I execute frequently in a day with different arguments and/or options each ti开发者_运维知识库me. What I am looking for is a way to "browse through" different executions of this shell script before selecting a particular one through CtrlR facility. How do I do that?
Ofcourse I can type "history" command and browse through the list manually;however I find CtrlR more convinient. :)
--
Ben
Try typing a common prefix and then pressing ctrl-r repeatedly to browse through different executions.
For example, let's say the command is vim, then:
- press CTRL-R to begin the reverse-i-search
- type vim
- press CTRL-R repeatedly to cycle through previous executions
$ history |grep vi
711 vi file
748 vi file
752 vi file
$ !711
精彩评论