第 30 章 Shell Terminal

30.1. terminal

30.1.1. resize - set TERMCAP and terminal settings to current xterm window size

显示终端屏幕的尺寸

$ resize
COLUMNS=151;
LINES=46;
export COLUMNS LINES;
			

设置终端屏幕的尺寸

eval `resize`
			

30.1.2. tset, reset - terminal initialization

tset -e ^? 设置Backspace删除前面一个字符
tset -k ^C 设置删除一行
			

建议使用stty替代tset

30.1.3. stty - change and print terminal line settings

$ stty
speed 38400 baud; line = 0;
eol = M-^?; eol2 = M-^?; swtch = M-^?;
ixany iutf8

$ stty -a
speed 115200 baud; rows 46; columns 151; 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
-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
OLDCONFIG=`stty -g`      # save configuration
stty -echo               # do not display password
echo "Enter password: \c"
read PASSWD              # get the password
stty $OLDCONFIG          # restore configuration
			

原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

时间: 2024-08-01 12:04:36

第 30 章 Shell Terminal的相关文章

第 8 章 Shell Terminal

dialog, whiptail, gdialog, kdialog and nautilus 目录 8.1. terminal 8.1.1. resize - set TERMCAP and terminal settings to current xterm window size 8.1.2. tset, reset - terminal initialization 8.1.3. stty - change and print terminal line settings 8.2. tp

第 30 章 Web Service Security

<?php /* * ===================================== * Website: http://netkiller.github.com * Author: neo <netkiller@msn.com> * Email: netkiller@msn.com * ===================================== */ class Logging { protected $file; public function __con

第 10 章 console / terminal

10.1. serial console gurb $ sudo vim /boot/grub/menu.lst title Ubuntu 8.04.1, kernel 2.6.24-21-generic root (hd0,5) kernel /boot/vmlinuz-2.6.24-21-generic root=UUID=3d5dd6c0-bbd2-4ddf-9b71-1c7b78e8de3b ro quiet splash console=tty0 console=ttyS0,38400

第 196 章 X Terminal

196.1. tsclient - Terminal Server Client supporting XDMCP, VNC and RDP 196.1.1. VNC 让tsclient支持vnc协议 sudo apt-get install xtightvncviewer 196.1.2. xdmcp 让tsclient支持xdmcp协议 sudo apt-get install xnest 原文出处:Netkiller 系列 手札 本文作者:陈景峯 转载请与作者联系,同时请务必标明文章原始出

第 30 章 GNU Development Tools

30.1. strip - Discard symbols from object files. 给C程序减肥 # cp nginx nginx.old # strip nginx # ll total 4984 -rwxr-xr-x 1 root root 545080 Oct 18 10:48 nginx -rwxr-xr-x. 1 root root 4554524 May 7 17:18 nginx.old 原文出处:Netkiller 系列 手札 本文作者:陈景峯 转载请与作者联系,同

第 5 章 Shell command

目录 5.1. Help Commands 5.1.1. man - an interface to the on-line reference manuals 5.1.1.1. manpath.config 5.1.1.2. 查看man手册位置 5.1.1.3. 指定手册位置 5.2. getconf - Query system configuration variables 5.3. Directory and File System Related 5.3.1. dirname 5.3.

第 27 章 Shell command

27.1. Help Commands 27.1.1. man - an interface to the on-line reference manuals 27.1.1.1. manpath.config cat /etc/manpath.config 27.1.1.2. 查看man手册位置 $ man -aw ls /usr/share/man/man1/ls.1.gz 27.1.1.3. 指定手册位置 man -M /home/mysql/man mysql 原文出处:Netkiller

跟老男孩学Linux运维:Shell编程实战.

Linux/Unix技术丛书 跟老男孩学Linux运维: Shell编程实战 老男孩 著 图书在版编目(CIP)数据 跟老男孩学Linux运维:Shell编程实战 / 老男孩著. -北京:机械工业出版社,2017.1 (Linux/Unix技术丛书) ISBN 978-7-111-55607-7 I. 跟- II. 老- III. Linux操作系统 IV. TP316.85 中国版本图书馆CIP数据核字(2016)第313248号 跟老男孩学Linux运维:Shell编程实战 出版发行:机械工

跟老男孩学Linux运维:Shell编程实战.2

第3章 Shell变量的核心基础知识与实践 3.1 什么是Shell变量 1.?什么是变量 在小学或初中时,我们开始接触数学方程式,例如:已知x=1,y=x+1,那么y等于多少? 在上述问题中,等号左边的x和y当时被称为未知数,但在Shell编程里它们是变量名,等号右边的1和x+1则是变量的内容(变量的值).注意,这里的等号符号被称为赋值,而不是等号. 通过上面的例子可以得出一个变量概念的小结论:简单地说,变量就是用一个固定的字符串(也可能是字符.数字等的组合)代替更多.更复杂的内容,该内容里可