Ctrl-R在csh中向后搜索shell命令 [英] Ctrl-R to search backwards for shell commands in csh
本文介绍了Ctrl-R在csh中向后搜索shell命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我喜欢这种在机壳中使用的快捷方式,并且想了解是否有可能在csh或tsch中模拟和/或拥有(也许安装附加组件或使用脚本)
I love this shortcut in borne shell, and want to find out if it is possible to simulate and/or have (perhaps to install an add-on or with a script) it in csh or tsch
谢谢
推荐答案
csh,tcsh甚至bash都具有好酷!历史替换。
Something that csh, tcsh, and even bash have is the cool ! history substitution.
% !cc
这将运行以 cc
% cc !*
提供上一条命令的参数
% g++ !cc:*
找到以 cc
开头的最后一条命令并替换其参数
That finds the last command that started with cc
and substitutes its parameters
% !?hello.c
这将找到最后一个命令其中有 hello.c
的地方。
This finds the last command that had hello.c
anywhere in it.
这篇关于Ctrl-R在csh中向后搜索shell命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文