在下面的例子中我通过'red'关键字进行查找,查找结果是包含这个关键字的cat /etc/redhat-release命令:
# [注意: 键入Ctrl+R 将显示一个如下的 reverse-i-search 窗口]
(reverse-i-search)'red': cat /etc/redhat-release
[Note: Press enter when you see your command, which
will execute the command from the history]
# cat /etc/redhat-release
Fedora release 9 (Sulphur)
有时候,你可能希望先编辑一下原来的命令然后再执行它。比如你查找httpd关键字,结果显示了service httpd stop命令,然后你可以把stop改成start然后再执行它。
# [注意: 键入Ctrl+R 将显示一个如下的 reverse-i-search 窗口](reverse-i-search)`httpd': service httpd stop
[Note: Press either left arrow or right arrow key when
you see your command, which will display the command
for you to edit, before executing it]
# service httpd start
No comments:
Post a Comment