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"那篇文章

posted on 2012-06-04 11:43  Lo0ong  阅读(22860)  评论(0编辑  收藏  举报

导航