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. 【LeetCode】10.Regular Expression Matching(dp)

    [题意] 给两个字符串s和p,判断s是否能用p进行匹配. [题解] dp[i][j]表示s的前i个是否能被p的前j个匹配. 首先可以分成3大类情况,我们先从简单的看起: (1)s[i - 1] = p ...

  2. P1115_最大子段和(JAVA语言)

    思路:贪心.累加求和,若和小于0则设置和为0,因为和小于0时对这段序列和无正作用,只会使整体变小,所以我们把小于0的段舍弃,从下一个数开始求序列和. 题目描述 给出一段序列,选出其中连续且非空的一段使 ...

  3. c++ 反汇编 异常处理

    c++异常处理 int main(){ try { throw 1; } catch ( int e ) { printf("catch int\r\n"); } catch ( ...

  4. 图解 | 原来这就是 IO 多路复用

    为了讲多路复用,当然还是要跟风,采用鞭尸的思路,先讲讲传统的网络 IO 的弊端,用拉踩的方式捧起多路复用 IO 的优势. 为了方便理解,以下所有代码都是伪代码,知道其表达的意思即可. Let's go ...

  5. Topshelf一个用于使用.NET构建Windows服务框架

    1 Topshelf是什么? Topshelf是用于托管使用.NET框架编写的Windows服务的框架.服务的创建得到简化,从而使开发人员可以创建一个简单的控制台应用程序,可以使用Topshelf将其 ...

  6. IndentationError:unexpected indent”、“IndentationError:unindent does not match any outer indetation level”以及“IndentationError:expected an indented block Python常见错误

    错误的使用缩进量 记住缩进增加只用在以:结束的语句之后,而之后必须恢复到之前的缩进格式. 经典错误,一定要注意缩进,尤其是在非界面化下环境的代码修改

  7. 1,turicreate入门 - jupyter & turicreate安装

    turicreate入门系列文章目录 1,turicreate入门 - jupyter & turicreate安装 2,turicreate入门 - 一个简单的回归模型 3,turicrea ...

  8. Linux 以非root用户安装zsh&配置on my zsh

    此文章参考以下三篇文章,如有侵权请联系 Linux非root用户安装zsh, 并用oh-my-zsh进行配置 在没有sudo权限的Linux服务器下安装oh-my-zsh 不使用root权限安装zsh ...

  9. C/C++中的const

    1 C中的const C中const修饰的变量是只读变量,在使用const关键字声明定义变量时会给该变量分配内存空间. const修饰的全局变量默认是外部链接的,即其它源文件可以直接使用该变量. co ...

  10. Spring Boot 快速迁移至 Quarkus

    Quarkus 是一个目前非常火的 Java 应用开发框架,定位是轻量级的微服务框架.,Quarkus 提供了优秀的容器化整合能力,相较于传统开发框架(Spring Boot)有着更快的启动速度.更小 ...