不用多说,自动补全可以节省大量时间
Ctrl + W 和 Ctrl + U 相当常用。拼写错是很常见的事。
Ctrl + L 也不用多说。
Alt + F 和 Alt + B 敝人也相当常用。这两个键用的是 Alt 而不是 Ctrl 键,所以在 Mac 的终端里会有问题。解决办法是在 偏好设置 - 描述文件 - 键盘 里,将 将 Option 键用作 Meta 键 选项打勾就行了。
Ctrl + C 是向当前运行的进程发送 SIGINT 信号,终止进程。
SIGINT - This signal is the same as pressing ctrl-c. On some systems, "delete" + "break" sends the same signal to the process. The process is interrupted and stopped. However, the process can ignore this signal.
Ctrl + Z 并不结束进程,而是挂起在后台。之后仍然可以通过 fg 命令恢复。对应的信号是 SIGTSTP。
SIGTSTP - This signal is like pressing ctrl-z. This makes a request to the terminal containing the process to ask the process to stop temporarily. The process can ignore the request.
经常看见别人找之前敲的命令会用 history,其实已经有现成的快捷键可以用。
按下 Ctrl + R 之后,输入查询的关键字,如果不符合,可以继续按 Ctrl + R 进行遍历。
这个命令其实也是通过 history 记录来查询的。如果不喜欢这种方式,可以直接 history | grep xxx 也是不错的。
