不曾用过的shell组合控制键

 用了很久的linux,今天才发现有几个有用的shell组合控制键从来都没有用到过。

    ^Z 暂停目前的命令
    ^S 暂停屏幕输出
    ^Q 恢复屏幕输出
    ^U 将命令列整列删除
    ^R 开始渐进收寻过去的命令
    ^W 从光标倒退删最后一个参数

    bash还默认支持Emacs模式下的组合键,如下:

    ^A 光标跳至行首,也可用
    ^E 光标跳至行末,也可用
    ^Y 贴上bash删除缓冲区里的内容 或
    ^_ undo
    Meta-B 光标倒退跳一个字
    Meta-F 光标向前跳一个字
    meta-d Kill from the cursor to the end of the current word, or, if between words, to the end of the next word.
    Meta-Y Rotate the kill-ring, and yank the new top

    bash也支持自定义宏

    ^x ( 开始纪录自定义宏
    ^x ) 结束纪录自定义宏
    ^x e 执行自定义宏

分享到