Chinaunix首页 | 论坛 | 博客
  • 博客访问: 466765
  • 博文数量: 89
  • 博客积分: 1126
  • 博客等级: 少尉
  • 技术积分: 1432
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-11 23:37
文章分类

全部博文(89)

文章存档

2016年(6)

2015年(2)

2014年(1)

2013年(3)

2012年(23)

2011年(54)

分类:

2011-07-02 11:24:03

原文地址:使用Bash Shell快捷键 作者:huxiao

移动类

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

阅读(882) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~