当前位置:网站首页>提升命令行效率的 Bash 快捷键 [完整版]
提升命令行效率的 Bash 快捷键 [完整版]
2022-07-26 05:10:00 【wild _wolf】
生活在 Bash shell 中,熟记以下快捷键,将极大的提高你的命令行操作效率。
编辑命令
Ctrl + a :移到命令行首
Ctrl + e :移到命令行尾
Ctrl + f :按字符前移(右向)
Ctrl + b :按字符后移(左向)
Alt + f :按单词前移(右向)
Alt + b :按单词后移(左向)
Ctrl + xx:在命令行首和光标之间移动
Ctrl + u :从光标处删除至命令行首
Ctrl + k :从光标处删除至命令行尾
Ctrl + w :从光标处删除至字首
Alt + d :从光标处删除至字尾
Ctrl + d :删除光标处的字符
Ctrl + h :删除光标前的字符
Ctrl + y :粘贴至光标后
Alt + c :从光标处更改为首字母大写的单词
Alt + u :从光标处更改为全部大写的单词
Alt + l :从光标处更改为全部小写的单词
Ctrl + t :交换光标处和之前的字符
Alt + t :交换光标处和之前的单词
Alt + Backspace:与 Ctrl + w 相同类似,分隔符有些差别
重新执行命令
Ctrl + r:逆向搜索命令历史
Ctrl + g:从历史搜索模式退出
Ctrl + p:历史中的上一条命令
Ctrl + n:历史中的下一条命令
Alt + .:使用上一条命令的最后一个参数
控制命令
Ctrl + l:清屏
Ctrl + o:执行当前命令,并选择上一条命令
Ctrl + s:阻止屏幕输出
Ctrl + q:允许屏幕输出
Ctrl + c:终止命令
Ctrl + z:挂起命令
Bang (!) 命令

友情提示:
以上介绍的大多数 Bash 快捷键仅当在 emacs 编辑模式时有效,若你将 Bash 配置为 vi 编辑模式,那将遵循 vi 的按键绑定。Bash 默认为 emacs 编辑模式。如果你的 Bash 不在 emacs 编辑模式,可通过 set -o emacs 设置。
^S、 ^Q、 ^C、 ^Z 是由终端设备处理的,可用 stty 命令设置。
边栏推荐
- ThreadLocal transfer between parent and child threads in asynchronous
- 【洛谷】P1383 高级打字机
- CountLaunch Demo的测试
- Axi protocol (5): burst mechanism of Axi protocol
- 阿里三面:MQ 消息丢失、重复、积压问题,如何解决?
- Go-Excelize API源码阅读(六)—— DeleteSheet(sheet string)
- Why is the value represented by a negative number greater than an integer by 1?
- The pit of history can only be filled up as far as possible
- MySQL master-slave synchronization and master-slave synchronization delay solution
- Unnamed Article 33
猜你喜欢

Recommend 12 academic websites for free literature search, and suggest to like and collect!

Redis expiration deletion strategy and memory obsolescence strategy

Go-Excelize API源码阅读(六)—— DeleteSheet(sheet string)

Shell的read 读取控制台输入、read的使用

Mysql优化

Alibaba three sides: how to solve the problems of MQ message loss, duplication and backlog?

Please elaborate on the implementation principle of synchronized and related locks

Recommendation system - machine learning

MySQL basic learning

C语言-指针进阶
随机推荐
Uniapp applet framework - a set of code, multi segment coverage
MySQL基础学习
时代潮流-云原生数据库的崛起
安装NCCL\mpirun\horovod\nvidia-tensorflow(3090Ti)
An online accident, I suddenly realized the essence of asynchrony
The pit of history can only be filled up as far as possible
SWAT模型在水文水资源、面源污染模拟中的实践技术
AQS唤醒线程的时候为什么从后向前遍历,我懂了
LeetCode链表问题——203.移除链表元素(一题一文学会链表)
异步时父子线程间的ThreadLocal传递问题
NPM operation instruction
The elderly who claim alimony from other children after being supported by their widowed daughter-in-law should be supported
一次线上事故,我顿悟了异步的精髓
JVM Lecture 2: class loading mechanism
C语言力扣第41题之缺失的第一个正数。两种方法,预处理快排与原地哈希
迁移服务器,重新配置数据库(数据库无监听,启动监听报TNS-12545、TNS-12560、TNS-00515错误)
C语言函数
[pytorch] install torch 1.8.1 and check whether torch version and GPU are available
C language function
推荐系统-机器学习