记得以前面试的时候被人问倒过,特意标记一下。
- linux下:
- ctrl-c 发送 SIGINT 信号给前台进程组中的所有进程。常用于终止正在运行的程序。
- ctrl-z 发送 SIGTSTP 信号给前台进程组中的所有进程,常用于挂起一个进程。
- ctrl-d 不是发送信号,而是表示一个特殊的二进制值,表示 EOF。
- ctrl-/ 发送 SIGQUIT 信号给前台进程组中的所有进程,终止前台进程并生成 core 文件。
- Key Function
- Ctrl-c Kill foreground process
- Ctrl-z Suspend foreground process
- Ctrl-d Terminate input, or exit shell
- Ctrl-s Suspend output
- Ctrl-q Resume output
- Ctrl-o Discard output
- Ctrl-l Clear screen
- 用stty -a看看终端配置。