Ctrl-R 在 csh 中向后搜索 shell 命令

发布于 2024-08-04 11:02:59 字数 90 浏览 4 评论 0原文

我喜欢 borne 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

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倦话 2024-08-11 11:02:59

尝试

bindkey "^R" i-search-back

Try

bindkey "^R" i-search-back
罪#恶を代价 2024-08-11 11:02:59

csh、tcsh 甚至 bash 所拥有的东西就是酷!历史替换。

这将运行以 cc 开头的最后一个命令:

% !cc

这提供了最后一个命令的参数:

% cc !*

这找到了以 cc 开头的最后一个命令并替换了它的参数:

% g++ !cc:*

这找到了最后一个命令中任何地方都有 hello.c

% !?hello.c

Something that csh, tcsh, and even bash have is the cool ! history substitution.

This will run the last command starting with cc:

% !cc

This supplies the parameters from the last command:

% cc !*

This finds the last command that started with cc and substitutes its parameters:

% g++ !cc:*

This finds the last command that had hello.c anywhere in it:

% !?hello.c
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文