stty 中文man頁(yè)面
名稱
stty - 改變并打印終端行設(shè)置
總覽
stty [-F device] [--file=device] [SETTING]...
stty [-F device] [--file=device] [-a|--all]
stty [-F device] [--file=device] [-g|--save]
描述
quot; Add any additional description here
打印或改變終端屬性.
- -a, --all
- 以可讀的格式打印當(dāng)前的所有設(shè)置
- -g, --save
- 以終端可讀的格式打印當(dāng)前的所有設(shè)置
- -F, --file
- 打開(kāi)指定的設(shè)備,并用此設(shè)備作為輸入來(lái)代替標(biāo)準(zhǔn)輸入
- --help
- 顯示幫助并退出
- --version
- 顯示版本信息并退出
選項(xiàng)-在SETTING之前使用這些選項(xiàng)將被視為無(wú)效 星號(hào)*表明是非POSIX設(shè)置. 以下是一些系統(tǒng)定義了的可用設(shè)置:
特殊字符
* dsusp CHAR CHAR表示輸入滿時(shí),發(fā)一個(gè)停止信號(hào)給終端
- eof CHAR
- CHAR表示一個(gè)文件結(jié)束 (結(jié)束輸入)
- eol CHAR
- CHAR表示當(dāng)前行結(jié)束
* eol2 CHAR CHAR是另一個(gè)表示結(jié)束當(dāng)前行的字符
- erase CHAR
- CHAR表示擦除最后一個(gè)輸入字符
- intr CHAR
- CHAR表示發(fā)一個(gè)中斷信號(hào)
- kill CHAR
- CHAR表示擦除當(dāng)前行
* lnext CHAR CHAR表示輸入下一個(gè)字符
- quit CHAR
- CHAR表示發(fā)出一個(gè)退出信號(hào)
* rprnt CHAR CHAR表示刷新當(dāng)前行
- start CHAR
- CHAR表示在停止輸出后重新開(kāi)始輸出
- stop CHAR
- CHAR表示停止輸出
- susp CHAR
- CHAR表示發(fā)送一個(gè)終端停止信號(hào)
* swtch CHAR CHAR表示切換到不同的外殼層
* werase CHAR CHAR表示擦除已經(jīng)輸入的最后一個(gè)單詞
特殊設(shè)置
- N
- 把輸入和輸出的波特率設(shè)為N
* cols N 通知內(nèi)核終端有N列
* columns N 與cols N 相同
- ispeed N
- 設(shè)置輸入速度為N
* line N 用行約束規(guī)則N
- min N
- 用 -icanon, 設(shè)置一次完整的讀操作最小為N個(gè)字符
- ospeed N
- 設(shè)置輸出速度為N
* rows N 通知內(nèi)核終端有N行
* size 根據(jù)內(nèi)核打印出終端的行數(shù)和列數(shù)
- speed
- 打印出終端的速度
- time N
- 同時(shí)用 -icanon, 設(shè)置讀超時(shí)為十分之N秒
控制設(shè)置
- [-]clocal
- 關(guān)閉解調(diào)器的控制信號(hào)
- [-]cread
- 允許接收輸入
* [-]crtscts 允許 RTS/CTS 的握手
- csN
- 把字符長(zhǎng)度設(shè)為N, N 為[5..8]
- [-]cstopb
- 對(duì)每字符使用兩個(gè)停止位 (一個(gè)帶有 `-')
- [-]hup
- 當(dāng)最后一個(gè)進(jìn)程關(guān)閉終端后,發(fā)一個(gè)掛起信號(hào)
- [-]hupcl
- 同 [-]hup
- [-]parenb
- 在輸出中產(chǎn)生奇偶校驗(yàn)位,并要求在輸入中也有奇偶校驗(yàn)位
- [-]parodd
- 設(shè)置奇校驗(yàn) (偶校驗(yàn)用 `-')
輸入設(shè)置:
- [-]brkint
- 暫停并產(chǎn)生中斷信號(hào)
- [-]icrnl
- 將回車解釋為換行
- [-]ignbrk
- 忽略中斷信號(hào)
- [-]igncr
- 忽略回車符
- [-]ignpar
- 忽略有奇偶校驗(yàn)錯(cuò)的字符
* [-]imaxbel 對(duì)一個(gè)字符產(chǎn)生嘟叫,但不刷新已滿的輸入緩沖區(qū)
- [-]inlcr
- 將換行解釋為回車
- [-]inpck
- 打開(kāi)輸入奇偶校驗(yàn)
- [-]istrip
- 清除輸入字符的高位(第8位)
* [-]iuclc 將大寫字符轉(zhuǎn)換成小寫字符
* [-]ixany 使任何字符都重新開(kāi)始輸出(而 不僅僅是重新輸出字符能實(shí)現(xiàn)此功能)
- [-]ixoff
- 打開(kāi)發(fā)送開(kāi)始/停止字符的開(kāi)關(guān)
- [-]ixon
- 打開(kāi)XON/XOFF的流量控制
- [-]parmrk
- 標(biāo)記奇偶校驗(yàn)錯(cuò)誤 (使用255-0-character 字符序列)
- [-]tandem
- 同 [-]ixoff
輸出設(shè)置:
* bsN 回退延遲, N 為 [0..1]
* crN 回車延遲, N 為 [0..3]
* ffN 換頁(yè)延遲, N 為 [0..1]
* nlN 換行延遲, N 為 [0..1]
* [-]ocrnl 將回車解釋為換行
* [-]ofdel 使用刪除字符來(lái)填充,而不是用空字符填充
* [-]ofill 使用填充字符,不使用定時(shí)延遲
* [-]olcuc 將小寫字符轉(zhuǎn)換成大寫
* [-]onlcr 將換行解釋為回車-換行
* [-]onlret 換行執(zhí)行一次回車
* [-]onocr 不在第一列打印回車
- [-]opost
- postprocess 輸出
* tabN 水平tab鍵延遲, N 為 [0..3]
* tabs 同tab0
* -tabs 同tab3
* vtN 垂直方向tab鍵延遲。。。, N 為 [0..1]
本地設(shè)置:
- [-]crterase
- 將擦除字符顯示為:退格-空格-退格
* crtkill 根據(jù)echoprt和echoe的設(shè)置去除所有行
* -crtkill 根據(jù)echoctl和echok設(shè)置去除所有行
* [-]ctlecho 在頭部符號(hào)中顯示控制字符'^c')
- [-]echo
- 顯示輸入字符
* [-]echoctl 同 [-]ctlecho
- [-]echoe
- 同[-]crterase
- [-]echok
- 在一個(gè)殺死字符后顯示一個(gè)換行
* [-]echoke 同 [-]crtkill
- [-]echonl
- 即使不顯示其它字符也換行
* [-]echoprt 向后顯示在 '' 和 '/'之間的擦除字符
- [-]icanon
- 打開(kāi) erase, kill, werase, 和 rprnt 這些特殊字符
- [-]iexten
- 打開(kāi) 非POSIX 特殊字符
- [-]isig
- 打開(kāi)中斷,退出和掛起這些特殊字符
- [-]noflsh
- 在中斷和退出這些特殊字符后禁止刷新
* [-]prterase 同 [-]echoprt
* [-]tostop 停止試圖寫終端的后臺(tái)作業(yè)
* [-]xcase 與icanon同時(shí)使用, 表示用`'退出大寫狀態(tài)
綜合設(shè)置:
* [-]LCASE 同 [-]lcase
- cbreak
- 同 -icanon
- -cbreak
- 同 icanon
- cooked
- 同 brkint ignpar istrip icrnl ixon opost isig icanon, eof 和 eol 字符被設(shè)為默認(rèn)值
- -cooked
- 同 raw
- crt
- 同 echoe echoctl echoke
- dec
- 同 echoe echoctl echoke -ixany intr ^c erase 0177 kill ^u
* [-]decctlq 同 [-]ixany
- ek
- 將擦除,殺死字符設(shè)為它們的默認(rèn)值
- evenp
- 同 parenb -parodd cs7
- -evenp
- 同 -parenb cs8
* [-]lcase 同 xcase iuclc olcuc
- litout
- 同 fB-parenb -istrip -opost cs8
- -litout
- 同 parenb istrip opost cs7
- nl
- 同 -icrnl -onlcr
- -nl
- 同 icrnl -inlcr -igncr onlcr -ocrnl -onlret
- oddp
- 同 parenb parodd cs7
- -oddp
- 同 -parenb cs8
- [-]parity
- 同 [-]evenp
- pass8
- 同 -parenb -istrip cs8
- -pass8
- 同 parenb istrip cs7
- raw
- 同 -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuc lc -ixany -imaxbel -opost -isig -icanon -xcase min 1 ti me 0
- -raw
- 同 cooked
- sane
- 同 cread -ignbrk brkint -inlcr -igncr icrnl -ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff 0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke, 所有特殊字符使用缺省值.
本命令處理連接到標(biāo)準(zhǔn)輸入的終端行.如不帶參數(shù),則輸出波特率, 行的約束規(guī)則,以及與健全的stty相背離的設(shè)置.在設(shè)置中, CHAR 是逐字讀取的, 或是象 ^c, 0x37, 0177 或127這樣的編碼; 特殊值 ^- 或未定義被用來(lái)禁止特殊字符.
報(bào)告臭蟲
報(bào)告臭蟲向.
參見(jiàn)
完整的文檔 stty 保持為Texinfo手冊(cè). 如果 info 及 stty 在你的機(jī)器上正確安裝的話, 命令
- info stty
會(huì)使你能夠讀取完整的手冊(cè).
#p#
NAME
stty - change and print terminal line settings
SYNOPSIS
stty [-F DEVICE] [--file=DEVICE] [SETTING]...
stty [-F DEVICE] [--file=DEVICE] [-a|--all]
stty [-F DEVICE] [--file=DEVICE] [-g|--save]
DESCRIPTION
Print or change terminal characteristics.
- -a, --all
- print all current settings in human-readable form
- -g, --save
- print all current settings in a stty-readable form
- -F, --file=DEVICE
- open and use the specified DEVICE instead of stdin
- --help
- display this help and exit
- --version
- output version information and exit
Optional - before SETTING indicates negation. An * marks non-POSIX settings. The underlying system defines which settings are available.
Special characters:
- * dsusp CHAR
- CHAR will send a terminal stop signal once input flushed
- eof CHAR
- CHAR will send an end of file (terminate the input)
- eol CHAR
- CHAR will end the line
- * eol2 CHAR
- alternate CHAR for ending the line
- erase CHAR
- CHAR will erase the last character typed
- intr CHAR
- CHAR will send an interrupt signal
- kill CHAR
- CHAR will erase the current line
- * lnext CHAR
- CHAR will enter the next character quoted
- quit CHAR
- CHAR will send a quit signal
- * rprnt CHAR
- CHAR will redraw the current line
- start CHAR
- CHAR will restart the output after stopping it
- stop CHAR
- CHAR will stop the output
- susp CHAR
- CHAR will send a terminal stop signal
- * swtch CHAR
- CHAR will switch to a different shell layer
- * werase CHAR
- CHAR will erase the last word typed
Special settings:
- N
- set the input and output speeds to N bauds
- * cols N
- tell the kernel that the terminal has N columns
- * columns N
- same as cols N
- ispeed N
- set the input speed to N
- * line N
- use line discipline N
- min N
- with -icanon, set N characters minimum for a completed read
- ospeed N
- set the output speed to N
- * rows N
- tell the kernel that the terminal has N rows
- * size
- print the number of rows and columns according to the kernel
- speed
- print the terminal speed
- time N
- with -icanon, set read timeout of N tenths of a second
Control settings:
- [-]clocal
- disable modem control signals
- [-]cread
- allow input to be received
- * [-]crtscts
- enable RTS/CTS handshaking
- csN
- set character size to N bits, N in [5..8]
- [-]cstopb
- use two stop bits per character (one with `-')
- [-]hup
- send a hangup signal when the last process closes the tty
- [-]hupcl
- same as [-]hup
- [-]parenb
- generate parity bit in output and expect parity bit in input
- [-]parodd
- set odd parity (even with `-')
Input settings:
- [-]brkint
- breaks cause an interrupt signal
- [-]icrnl
- translate carriage return to newline
- [-]ignbrk
- ignore break characters
- [-]igncr
- ignore carriage return
- [-]ignpar
- ignore characters with parity errors
- * [-]imaxbel
- beep and do not flush a full input buffer on a character
- [-]inlcr
- translate newline to carriage return
- [-]inpck
- enable input parity checking
- [-]istrip
- clear high (8th) bit of input characters
- * [-]iuclc
- translate uppercase characters to lowercase
- * [-]ixany
- let any character restart output, not only start character
- [-]ixoff
- enable sending of start/stop characters
- [-]ixon
- enable XON/XOFF flow control
- [-]parmrk
- mark parity errors (with a 255-0-character sequence)
- [-]tandem
- same as [-]ixoff
Output settings:
- * bsN
- backspace delay style, N in [0..1]
- * crN
- carriage return delay style, N in [0..3]
- * ffN
- form feed delay style, N in [0..1]
- * nlN
- newline delay style, N in [0..1]
- * [-]ocrnl
- translate carriage return to newline
- * [-]ofdel
- use delete characters for fill instead of null characters
- * [-]ofill
- use fill (padding) characters instead of timing for delays
- * [-]olcuc
- translate lowercase characters to uppercase
- * [-]onlcr
- translate newline to carriage return-newline
- * [-]onlret
- newline performs a carriage return
- * [-]onocr
- do not print carriage returns in the first column
- [-]opost
- postprocess output
- * tabN
- horizontal tab delay style, N in [0..3]
- * tabs
- same as tab0
- * -tabs
- same as tab3
- * vtN
- vertical tab delay style, N in [0..1]
Local settings:
- [-]crterase
- echo erase characters as backspace-space-backspace
- * crtkill
- kill all line by obeying the echoprt and echoe settings
- * -crtkill
- kill all line by obeying the echoctl and echok settings
- * [-]ctlecho
- echo control characters in hat notation (`^c')
- [-]echo
- echo input characters
- * [-]echoctl
- same as [-]ctlecho
- [-]echoe
- same as [-]crterase
- [-]echok
- echo a newline after a kill character
- * [-]echoke
- same as [-]crtkill
- [-]echonl
- echo newline even if not echoing other characters
- * [-]echoprt
- echo erased characters backward, between `\' and '/'
- [-]icanon
- enable erase, kill, werase, and rprnt special characters
- [-]iexten
- enable non-POSIX special characters
- [-]isig
- enable interrupt, quit, and suspend special characters
- [-]noflsh
- disable flushing after interrupt and quit special characters
- * [-]prterase
- same as [-]echoprt
- * [-]tostop
- stop background jobs that try to write to the terminal
- * [-]xcase
- with icanon, escape with `\' for uppercase characters
Combination settings:
- * [-]LCASE
- same as [-]lcase
- cbreak
- same as -icanon
- -cbreak
- same as icanon
- cooked
- same as brkint ignpar istrip icrnl ixon opost isig icanon, eof and eol characters to their default values
- -cooked
- same as raw
- crt
- same as echoe echoctl echoke
- dec
- same as echoe echoctl echoke -ixany intr ^c erase 0177 kill ^u
- * [-]decctlq
- same as [-]ixany
- ek
- erase and kill characters to their default values
- evenp
- same as parenb -parodd cs7
- -evenp
- same as -parenb cs8
- * [-]lcase
- same as xcase iuclc olcuc
- litout
- same as -parenb -istrip -opost cs8
- -litout
- same as parenb istrip opost cs7
- nl
- same as -icrnl -onlcr
- -nl
- same as icrnl -inlcr -igncr onlcr -ocrnl -onlret
- oddp
- same as parenb parodd cs7
- -oddp
- same as -parenb cs8
- [-]parity
- same as [-]evenp
- pass8
- same as -parenb -istrip cs8
- -pass8
- same as parenb istrip cs7
- raw
- same as -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon -xcase min 1 time 0
- -raw
- same as cooked
- sane
- same as cread -ignbrk brkint -inlcr -igncr icrnl -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, all special characters to their default values.
Handle the tty line connected to standard input. Without arguments, prints baud rate, line discipline, and deviations from stty sane. In settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or 127; special values ^- or undef used to disable special characters.
AUTHOR
Written by David MacKenzie.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright © 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
The full documentation for stty is maintained as a Texinfo manual. If the info and stty programs are properly installed at your site, the command
- info coreutils stty
should give you access to the complete manual.


















