使用Bash Shell快捷键

本文总结了Emacs编辑器中的常用快捷键,包括移动类、编辑类和历史类等操作。移动类如Ctrl+a(跳到行首)、Ctrl+e(跳到行尾);编辑类如Ctrl+u(删除光标到行首的内容)、Ctrl+k(删除光标到行尾的内容);历史类如Ctrl+p(翻看历史记录的上一条)。此外还介绍了撤销、复制粘贴等常用编辑操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

移动类
Ctrl + a  - Jump to the start of the line  //跳到行首
Ctrl + e - Jump to the end of the line //跳到行尾
Ctrl + b - Move back a char //向前移动(一个字符) Ctrl + f - Move forward a char //向后移动(一个字符) Alt + b - Move backward //向前移动(一个单词) Alt + f - Move forward //向后移动(一个单词)
Ctrl + xx - Move between EOL and current cursor position

//前后游走(光标和行尾)
编辑类
Ctrl + u  - Delete backward from cursor     //删除操作(光标到行首)

Ctrl + k - Delete to EOL //删除操作(光标到行尾)
Alt + d - Delete word //删除操作(光标到字尾)
Ctrl + w - Delete word //删除操作(光标到字首)
Ctrl + y - Yank/Paste //粘贴操作

Ctrl + d - Delete from under the cursor //等于Delete
Ctrl + _ - Undo //撤销改动
Alt + t - Transpose/drag //字字调位

Ctrl + t - Transpose/drag //字符调位
历史类
Ctrl + p  - Move in history                 //翻看历史(上一条)
Ctrl + n - Move in history //翻看历史(下一条)
Alt + > - Move in history //翻看历史(下一条)
等待发现
输入 bind -P 可以查看所有的键盘绑定。
$ 2T - All available commands(common) 
$ (string)2T - All available commands starting with (string)
$ /2T - Entire directory structure including Hidden one
$ ./2T - Only Sub Dirs inside including Hidden one
$ *2T - Only Sub Dirs inside without Hidden one
$ ~2T - All Present Users on system from "/etc/passwd" 
$ $2T - All Sys variables 
$ @2T - Entries from "/etc/hosts"
$ =2T - Output like ls or dir
Note : "2T" means Press TAB twice
FROM: http://www.bigsmoke.us/readline/shortcuts
Emacs keysActionScopeDirection/Place
Moving aroundCtrl-bMove the cursorone character⇦ to the left
Ctrl-fMove the cursorone character⇨ to the right
Alt-bMove the cursorone word⇦ to the left
Alt-fMove the cursorone word⇨ to the right
Ctrl-aMove the cursor⇤ to the start of the line
Ctrl-eMove the cursor⇥ to the end of the line
Ctrl-x-xMove the cursor⇤⇥ to the start, and to the end again
Cut, copy
and paste
BackspaceDeletethe character⇦ to the left of the cursor
DEL
Ctrl-d
Deletethe characterunderneath the cursor
Ctrl-uDeleteeverything⇤ from the cursor back to the line start
Ctrl-kDeleteeverything⇥ from the cursor to the end of the line
Alt-dDeleteword⇨ untill before the next word boundary
Ctrl-wDeleteword⇦ untill after the previous word boundary
Ctrl-yYank/Pasteprev. killed textat the cursor position
Alt-yYank/Pasteprev. prev. killed textat the cursor position
HistoryCtrl-pMove in historyone line⇧ before this line
Ctrl-nMove in historyone line⇩ after this line
Alt->Move in historyall the lines⇩ to the line currently being entered
Ctrl-rIncrementally search the line history⇧ backwardly
Ctrl-sIncrementally search the line history⇩ forwardly
Ctrl-JEnd an incremental search
Ctrl-GAbort an incremental search and restore the original line
Alt-Ctrl-yYank/Pastearg. 1 of prev. cmndat the cursor position
Alt-.
Alt-_
Yank/Pastelast arg of prev. cmndat the cursor position
UndoCtrl-_
Ctrl-x
Ctrl-u
Undo the last editing command; you can undo all the way back to an empty line
Alt-rUndo all changes made to this line
Ctrl-lClear the screen, reprinting the current line at the top
Ctrl-lClear the screen, reprinting the current line at the top
CompletionTABAuto-complete a name
Alt-/Auto-complete a name (without smart completion)
Alt-?List the possible completions of the preceeding text
Alt-*Insert all possible completions of the preceeding text
TransposeCtrl-tTranspose/dragchar. before the cursor↷ over the character at the cursor
Alt-tTranspose/dragword before the cursor↷ over the word at/after the cursor

<script>window._bd_share_config={"common":{"bdsnskey":{},"bdtext":"","bdmini":"2","bdminilist":false,"bdpic":"","bdstyle":"0","bdsize":"16"},"share":{}};with(document)0[(getelementsbytagname('head')[0]||body).appendchild(createelement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new date()/36e5)];</script>
阅读(315) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值