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