++++++++++++++++++++Ctrl相关++++++++++++++++++++++++
ctrl+a 切换至命令的开始
ctrl+e 切换至命令的结尾
ctrl+u 清除光标前面的内容
ctrl+k 清除光标后面的内容
ctrl+l 清屏
ctrl+r 搜索小写开头历史记录
ctrl+R 搜索大写开头的历史记录
ctrl+y 粘贴刚才所删除的字符
ctrl+w 清除最后输入的一个word.
ctrl+h 清除光标前一个字符
ctrl+d 清除当前光标的字符并缩进.
ctrl+t 将光标前面1个字符向后移动一个位置.
ctrl+b 光标往左移动一个字符.
ctrl+f 光标往右移动一个字符.
ctrl+z 停止正在运行的程序,并放到后台.
按esc后b 光标向左移动一个单词位.
俺esc后f 光标向右移动一个单词位.
+++++++++++++++++++++Alt相关++++++++++++++++++++
Alt + < - Move to the first line in the history
Alt + > - Move to the last line in the history
Alt + ? - Show current completion list
Alt + * - Insert all possible completions
Alt + / - Attempt to complete filename
Alt + . - Yank last argument to previous command
Alt + b - Move backward
Alt + c - Capitalize the word
Alt + d - Delete word
Alt + f - Move forward
Alt + l - Make word lowercase
Alt + n - Search the history forwards non-incremental
Alt + p - Search the history backwards non-incremental
Alt + r - Recall command
Alt + t - Move words around
Alt + u - Make word uppercase
Alt + back-space - Delete backward from cursor
输入 bind -P 可以查看所有的键盘绑定;有些可能会与远程工具冲突。
Here "2T" means Press TAB twice
$ 2T - All available commands(common) //命令行补全,我认为是 Bash 最好用的一点
$ (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 //写Shell脚本的时候很实用
$ @2T - Entries from "/etc/hosts" //第一次见到
$ =2T - Output like ls or dir //好像还不如 ls 快捷
补充:
Esc + T - 交换光标前面的两个单词
参考文档:http://www.bigsmoke.us/readline/shortcuts
转载于:https://blog.51cto.com/5iqiong/677575