zxc的自留地

About Me

CLI快捷键

January 20, 2020

前言

记录 shell 快捷键

快捷键

命令 说明
Ctrl-A 从当前位置跳转到行首
Ctrl-E 从当前位置跳转到行尾
Ctrl-B 从当前位置往前移动一个字符
Ctrl-F 从当前位置往后移动一个字符
Alt-B 移动到下一个单词的首字符
Alt-F 移动到上一个单词的最后一个字符
Ctrl-W 从当前位置向前删除到第一个非空字符
Alt-D 从当前位置向后删除到第一个非空字符
Ctrl-U 从当前位置向前清空所有
Ctrl-K 从当前位置向后清空所有
Ctrl-D 向前删除一个字符

方便记忆

图片来自推特

卡片

Iterm2 使用 Alt 配置

Q: How do I make the option/alt key act like Meta or send escape codes?

A: Go to Preferences > Profiles tab.
Select your profile on the left, and then open the Keyboard tab.
At the bottom is a set of buttons that lets you select the behavior of the Option key.
For most users, Esc+ will be the best choice.

Referance