程式 : stty



(a) 所在系統與路徑

系統 : RedHat 7.0 (Linux kernel 2.2.17-14)
路徑 : /bin/



(b) 使用的 shared library

/lib/libc.so.6
/lib/ld-linux.so.2



(c) 主要用途說明

顯示與改變終端機設定.

當顯示終端機設定時, 用法如下 :
$ stty [-OPTIONS]

當改變終端機設定時, 用法如下 :
$ stty FUNCTION KEY


(d) 所支援的參數及其意義

-不加任何參數
顯示終端機的基本設定.

-a, --all
顯示所有目前終端機的設定, 並且是以人類可讀的方式顯示.

-g, --save
顯示所有目前終端機的設定, 並且是用 stty 程式內部的表示方式.



(e) 使用範例

(以下三個為改變終端機設定的範例)
$ stty kill ^H

$ stty intr ^C

$ stty susp ^Z

(以下三個為在文字模式下使用的範例)
$ stty
speed 38400 baud; line = 0;
-brkint -imaxbel

$ stty -a
 
speed 38400 baud; rows 25; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; 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

-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel
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

$ stty -g
500:5:4bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

(以下三個為在XWindow的終端機程式下使用的範例)
$ stty
speed 38400 baud; line = 192;

$ stty -a
speed 38400 baud; rows 24; columns 80; line = 192;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -cclocal -crtscts

-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany imaxbel
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

$ stty -g
2506:5:bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:12:40:0:0:0:0:0:0:0:0:0:0:0:0:0