zoukankan      html  css  js  c++  java
  • EV: Linux Shell Shortcuts

    Source: http://superuser.com/questions/322367/are-there-any-unix-shells-that-support-mouse-reporting/322443#322443

     

    Sounds like you would benefit from investing a short amount of time in learning some defaultreadline keyboard shortcuts. Note that user606723's answer above gives some basic ones but theHome and Alt+arrow keys do not work on all terminals. Here are a few of the ones I find the following most useful and which also work in more terminals.

    (Unless otherwise noted, "word" means an alphanumeric string.)

    • Alt-f: go one word forward.
    • Alt-b: go one word back.
    • Ctrl-a: go to beginning of line
    • Ctrl-e: go to end of line
    • Alt-d: delete to end of word
    • Alt-Backspace: delete to beginning of word
    • Ctrl-w: delete backwards to whitespace
    • Ctrl-y: paste most recently deleted text
    • Ctrl-bCtrl-f: move backward/forward one character, equivalent to left and right
    • Ctrl-hCtrl-d: equivalent to Backspace and Delete, respectively.

    I list the last few because I find them more convenient than reaching for the arrow keys or delete/backspace. You can see how with these basic shortcuts you can do quite a bit of editing rather easily. But there are more:

    • Alt-.: rotate through the last word (white-space delimited) of the previous lines in history. Using it one gets you the last argument of the most recent command you typed.
    • Ctrl-_: undo (incremental)
    • Ctrl-]: search forward for character (like f in vim, but less convenient)
    • Ctrl-r: reverse history search
    • Alt-0...Alt-9: numeric argument to next command. For example if you wanted to delete 4 words: Alt-4Alt-d. Or if you need 1024 A's on the command line for some reason:Alt-1024A.
    • Ctrl-u: delete from cursor position to beginning of line
    • Ctrl-k: delete from cursor position to end of line

    And these are just a few of the ones I use - there are many more in the manpage.

  • 相关阅读:
    Vue 登录/登出以及JWT认证
    Vue render函数 函数时组件 jsx
    Mock简明文档
    Vue axios封装 实现请求响应拦截
    Promise场景实例之图片加载
    第一章 HTML5基础
    python if的选择结构与循环
    python 字典
    CentOS 6.5设置静态IP教程 并且可以ping通
    centos 主从复制
  • 原文地址:https://www.cnblogs.com/weihongji/p/3493069.html
Copyright © 2011-2022 走看看