ctrl+c,ctrl+d,ctrl+z在linux中意義


本文轉自網上.

 

控制字符都是可以用(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-z 是發送 SIGSTOP信號,掛起一個進程
ctrl-d 不是發送信號,而是表示一個特殊的二進制值,表示 EOF
 
但是ctrl-d在具體比如getchar應用中又有些特別之處,可以參考"getchar()和EOF"那篇文章


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM