关闭

使用Bash Shell快捷键

100人阅读 评论(0) 收藏 举报
分类:

移动类

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 keys Action Scope Direction/Place
Moving around Ctrl-b Move the cursor one character ⇦ to the left
Ctrl-f Move the cursor one character ⇨ to the right
Alt-b Move the cursor one word ⇦ to the left
Alt-f Move the cursor one word ⇨ to the right
Ctrl-a Move the cursor ⇤ to the start of the line
Ctrl-e Move the cursor ⇥ to the end of the line
Ctrl-x-x Move the cursor ⇤⇥ to the start, and to the end again
Cut, copy
and paste
Backspace Delete the character ⇦ to the left of the cursor
DEL
Ctrl-d
Delete the character underneath the cursor
Ctrl-u Delete everything ⇤ from the cursor back to the line start
Ctrl-k Delete everything ⇥ from the cursor to the end of the line
Alt-d Delete word ⇨ untill before the next word boundary
Ctrl-w Delete word ⇦ untill after the previous word boundary
Ctrl-y Yank/Paste prev. killed text at the cursor position
Alt-y Yank/Paste prev. prev. killed text at the cursor position
History Ctrl-p Move in history one line ⇧ before this line
Ctrl-n Move in history one line ⇩ after this line
Alt-> Move in history all the lines ⇩ to the line currently being entered
Ctrl-r Incrementally search the line history ⇧ backwardly
Ctrl-s Incrementally search the line history ⇩ forwardly
Ctrl-J End an incremental search
Ctrl-G Abort an incremental search and restore the original line
Alt-Ctrl-y Yank/Paste arg. 1 of prev. cmnd at the cursor position
Alt-.
Alt-_
Yank/Paste last arg of prev. cmnd at the cursor position
Undo Ctrl-_
Ctrl-x
Ctrl-u
Undo the last editing command; you can undo all the way back to an empty line
Alt-r Undo all changes made to this line
Ctrl-l Clear the screen, reprinting the current line at the top
Ctrl-l Clear the screen, reprinting the current line at the top
Completion TAB Auto-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
Transpose Ctrl-t Transpose/drag char. before the cursor ↷ over the character at the cursor
Alt-t Transpose/drag word 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) |
给主人留下些什么吧!~~
评论热议
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:32704次
    • 积分:399
    • 等级:
    • 排名:千里之外
    • 原创:90篇
    • 转载:10篇
    • 译文:0篇
    • 评论:0条
    文章分类