控制字符都是可以用(stty命令)更改的。
用stty -a看看終端配置。
[loong@localhost ~]$ stty -a speed 38400 baud; rows 24; columns 80; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts -cdtrdsr -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
ctrl-c 是發送 SIGINT 信號,終止一個進程
但是ctrl-d在具體比如getchar應用中又有些特別之處,可以參考"getchar()和EOF"那篇文章
以上轉自:http://www.cnblogs.com/xlmeng1988/archive/2012/06/04/ctrl.html
以下文字轉自:http://blog.chinaunix.net/uid-23960482-id-111808.html
ctrl+c和ctrl+z都是中斷命令,但是他們的作用卻不一樣.
ctrl+c是強制中斷程序的執行,
而ctrl+z的是將任務中斷,但是此任務並沒有結束,他仍然在進程中他只是維持掛起的狀態,用戶可以使用fg/bg操作繼續前臺或後臺的任務,fg命令重新啓動前臺被中斷的任務,bg命令把被中斷的任務放在後臺執行.
例如:
當你vi一個文件是,如果需要用shell執行別的操作,但是你又不打算關閉vi,因爲你得
存盤推出,你可以簡單的按下ctrl+z,shell會將vi進程掛起~,當你結束了那個shell操作之後,你可以用fg命令繼續vi你的文件.