Bash是GNU计划的一部分,是多数Linux发行版提供的默认Shell。 Linux的精髓就在于命令行的高效,而学习命令行的第一步便是学习如何快速地输入命令。

其实包括Bash在内的多数Linux Shell都是使用一个叫GNU Readline Library的库来接受用户输入。 所以这些快捷键在多数Shell下都适用~

命令编辑

快捷键 描述
Ctrl + a go to the start of the command line
Ctrl + e go to the end of the command line
Ctrl + k delete from cursor to the end of the command line
Ctrl + u delete from cursor to the start of the command line
Ctrl + w delete from cursor to start of word (i.e. delete backwards one word)
Ctrl + y paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
Ctrl + xx move between start of command line and current cursor position aand back again
Alt + b move backward one word (or go to start of word the cursor is currently on)
Alt + f move forward one word (or go to end of word the cursor is currently on)
Alt + d delete to end of word starting at cursor (whole word if cursor is at the beginning of word)
Alt + c capitalize to end of word starting at cursor (whole word if cursor is at the beginning of word)
Alt + u make uppercase from cursor to end of word
Alt + l make lowercase from cursor to end of word
Alt + t swap current word with previous
Ctrl + f move forward one character
Ctrl + b move backward one character
Ctrl + d delete character under the cursor
Ctrl + h delete character before the cursor
Ctrl + t swap character under cursor with the previous one

历史命令

快捷键 描述
Ctrl + r search the history backwards
Ctrl + g escape from history searching mode
Ctrl + p previous command in history (i.e. walk back through the command history)
Ctrl + n next command in history (i.e. walk forward through the command history)
Alt + . use the last word of the previous command

命令控制

快捷键 描述
Ctrl + l clear the screen
Ctrl + s stops the output to the screen (for long running verbose command)
Ctrl + q allow output to the screen (if previously stopped using command above)
Ctrl + c terminate the command
Ctrl + z suspend/stop the command
Ctrl + d end of input

熟悉 Bash 快捷键来提高效率的更多相关文章

  1. [转]让你提升命令行效率的 Bash 快捷键

    生活在 Bash shell 中,熟记以下快捷键,将极大的提高你的命令行操作效率. 编辑命令 Ctrl + a :移到命令行首 Ctrl + e :移到命令行尾 Ctrl + f :按字符前移(右向) ...

  2. 让你提升命令行效率的 Bash 快捷键

    生活在 Bash shell 中,熟记以下快捷键,将极大的提高你的命令行操作效率. 编辑命令 Ctrl + a :移到命令行首 Ctrl + e :移到命令行尾 Ctrl + f :按字符前移(右向) ...

  3. 让你提升命令行效率的 Bash 快捷键 [完整版]

    转自:http://linuxtoy.org/archives/bash-shortcuts.html 生活在 Bash shell 中,熟记以下快捷键,将极大的提高你的命令行操作效率. 大部分对其他 ...

  4. PHPstorm最常用的快捷键,提高开发效率

    PHPstorm最常用的快捷键,提高开发效率 •ctrl+b 跳到变量申明处 •Ctrl + E 打开最近文件 •Ctrl + R 替换. •Ctrl + D 复制粘贴.将当前行或者选择的内容复制粘贴 ...

  5. 几个提高效率的PHOTOSHOP秘密快捷键

    1.拖动选择 使用矩形选框工具,在画布上拖动(不要松开鼠标),这时按住空格键,然后移动鼠标,你会发现选区也跟着移动了. 2.左右流量文档 按住Cmd(Ctrl)键,上下滚动鼠标,你会发现文档的滚动条在 ...

  6. 提升命令行效率的Bash快捷键

    转自:http://linuxtoy.org/archives/bash-shortcuts.html 生活在 Bash shell 中,熟记以下快捷键,将极大的提高你的命令行操作效率. 大部分对其他 ...

  7. 分享两个提高效率的AndroidStudio小技巧

    这次分享两个 Android Studio 的小技巧,能够有效提高效率和减少犯错,尤其是在团队协作开发中. Getter 模板修改--自动处理 null 判断 格式化代码自动整理方法位置--广度 or ...

  8. 提高效率的Linux命令

    提高效率的Linux命令 一.fc 二.disown 三.Ctrl + x +e 四.!! 两个感叹号 五.一次创建多个目录或文件 六.tee 七.删除从开头到光标处的命令文本 八.删除从光标到结尾处 ...

  9. [转]bash快捷键

    生活在 Bash shell 中,熟记以下快捷键,将极大的提高你的命令行操作效率. 编辑命令 Ctrl + a :移到命令行首 Ctrl + e :移到命令行尾 Ctrl + f :按字符前移(右向) ...

随机推荐

  1. Shuffle Card HDU - 6707

    题目链接:https://vjudge.net/problem/HDU-6707 题意:给你一个数组a[ ](a[1]=1,a[2]=2.....a[n]=n),然后m次操作,每次把那个数拿到最前面去 ...

  2. 如何开发一个APP——转自知乎

    作者:简单点链接:https://www.zhihu.com/question/22999185/answer/155469014来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注 ...

  3. 【10.5NOIP普及模拟】sort

    [10.5NOIP普及模拟]sort 文章目录 [10.5NOIP普及模拟]sort 题目描述 输入 输出 输入输出样例 样例输入 样例输出 数据范围限制 解析 code 题目描述 小x和小y是好朋友 ...

  4. 使用Gensim库对文本进行词袋、TF-IDF和n-gram方法向量化处理

    Gensim库简介 机器学习算法需要使用向量化后的数据进行预测,对于文本数据来说,因为算法执行的是关于矩形的数学运算,这意味着我们必须将字符串转换为向量.从数学的角度看,向量是具有大小和方向的几何对象 ...

  5. 学习笔记-angular 使用uuid

    import { UUID } from 'angular2-uuid'; let uuid = UUID.UUID().replace(/-/g, '').toLocaleUpperCase(); ...

  6. 消息中间件-ActiveMQ高可用集群和持久化机制

    1.修改active.mq的xml文件 2.延时.调度消息 package com.study.mq.b1_message; import org.apache.activemq.ActiveMQCo ...

  7. java多种文件复制方式以及效率比较

    1.背景 java复制文件的方式其实有很多种,可以分为 传统的字节流读写复制FileInputStream,FileOutputStream,BufferedInputStream,BufferedO ...

  8. 黑马 - poi Excel2

    文件上传: //划线处值得效仿 构造用户列表:User.java 批量保存用户

  9. Ambassador-06-金丝雀部署

    金丝雀部署:Canary Releases ambassador使用加权循环,在多个服务之间路由流量.收集所有服务的完整指标,以便比较canary和production的相对性能.这个weight的值 ...

  10. 闲暇时光里最好的挖矿体验——CPU挖乌龟币

    我之前其实是不玩加密货币的,主要是没有钱取投资(tou ji),也没有钱去投资矿机. 不过前几天CSDN推送了一个短文,<黑客用GitHub服务器挖矿,三天跑了3万个任务,代码惊现中文> ...