MOVE :
ctrl B - F 前后移动一位
alt b-f 前后移动一单词
ctrl A - E 移到开头和最后
EDIT:
ctrl H-D :前后删除一位
ctrl U-K:删除 前后所有
ctrl W: alt d 删除前后一个单词
T: 字母后拉
P-N:前后一条指令
TAB: 指令补全
L:清屏
R: 搜索
Y: 粘贴
END:
I M O Q
无用:
S V X
# Ctrl A - Go to the beginning of the line you are currently typing on
# Ctrl E - Go to the end of the line you are currently typing on # Ctrl xx - Move between EOL and current cursor position
光标在当前行的开头和结尾切换
# Ctrl L - Clears the Screen, similar to the clear command
清屏,类似于 clear 命令
---------------------------------------
# Ctrl U - Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
清除光标之前的所有内容
# Ctrl K - Clear the line after the cursor ---------------------------------------
# Ctrl H - Same as backspace
退格键 backspace
# Alt F - Move cursor forward one word on the current line # Alt B - Move cursor backward one word on the current line ---------------------------------------
在图形界面下使用终端时按 Alt + F ,会打开当前窗口的文件下拉菜单。这样终端快捷键就不起作用了。可以通过更改终端配置来解决冲突。方法:点击终端窗口顶部菜单中的 Edit ,在下拉菜单中点击 Keyboard Shortcuts,然后在打开到窗口中,将Enable menu access keys 这项取消勾选就可以了。
这样就可以用shell自身的shortcuts了。
# Ctrl R - Let’s you search through previously used commands
从命令历史中找
# Ctrl C - Kill whatever you are running
终止命令
# Ctrl D - Exit the current shell
退出 shell
# Ctrl Z - Puts whatever you are running into a suspended background process. fg restores it.
这个指你想中断一下当前执行的程序,但又不想杀死它,可以把它放到后台,想继续执行时,用fg可以唤醒它。
---------------------------------------
# Ctrl W - Delete the word before the cursor
清除光标之前的一个词,一般是以空格格开,不会删一行。
# Alt D - Delete word after the cursor ---------------------------------------------
# Ctrl T - Swap the last two characters before the cursor
交换光标前的最后两个字符
# Alt T - Swap the last two words before the cursor
交换光标前的最后两个单词
# Tab - Auto-complete files and folder names
自动补全
# Ctrl Y - to paste it (as in delete and copy) all text in front of the cursor
粘贴(刚才 ctrl w 或者 ctrl k 的内容)
# Esc . (or Esc Underscore) - Insert Last Argument 比如我 运行 $ cd /
那么我执行“ Esc . ”, 就会插入 "/ " 这个参数
-------------------------------------
# Ctrl B - Move back a character
# Ctrl F - Move forward a character
将光标向前|后移动一个字母的距离,不改变任何东西。