linux stty命令學習

來源:互聯網
上載者:User

linux stty命令學習 stty命令用來修改和顯示終端行設定。 sh-# sttyspeed 115200 baud; line = 0;kill = ^X;-brkint ixany -imaxbel-iexten -echoe echoprtsh-# stty -aspeed 115200 baud; rows 0; columns 0; line = 0;intr = ^C; quit = ^\; erase = ^?; kill = ^X; eof = ^D; eol = <undef>;eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 1;-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts-ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff-iuclc ixany -imaxbel -iutf8opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0isig icanon -iexten echo -echoe echok -echonl -noflsh -xcase -tostop echoprtechoctl echoke CTRL+S,用來stop當前的shell;CTRL+Q,用來start當前的shell;CTRL+Z,用來suspend當前的shell;CTRL+C,用來interrupt當前執行的程式;... 這樣我們終於知道了為什麼在shell下鍵入按鍵組合CTRL+C,CTRL+D,CTRL+Z會有對應的處理了。原來是shell在運行時,它已經接管了對這些按鍵的處理了。 sh-# ps  PID TTY          TIME CMD  409 ?        00:00:00 init  943 ?        00:00:00 sh 1213 ?        00:00:00 sh 4918 ?        00:00:00 pssh-# kill -2 943 sh-#這裡我們測試了一下給當前shell發送SIGINT signal,由於當前shell下沒有運行任何命令或程式,所以看起來什麼都沒做。你也可以在shell下按按鍵組合CTRL+C來看看,沒錯,CTRL+C實際上就是給當前shell發送SIGINT,它們倆是等效的。 待解決問題:當我的終端類型為/dev/console時,在shell下按CTRL+S/CTRL+Q等按鍵組合沒有作用;sh-# tty/dev/console但是當我的終端類型為/dev/pts/6時在shell下按CTRL+S/CTRL+Q會產生作用;sh-# tty/dev/pts/6 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.