Commands

Commands

captoinfo

[-vn width] [-V] [-1] [-w width] file

Convert termcap entry to a description of a terminfo entry.

Example: To convert the entire default termcap file and send the results to standard out, use

captoinfo

-v

Output the specified (1 10) level of debugging information.

-V

Display version information and exit.

-1

Output fields one per line.

-w

Specify the width of output.

clear

Clear the terminal display screen.

Example: To clear all the characters currently displayed off your screen, use

clear

dumpkeys

[ -hilfn -ccharset --help --short-info --long-info --numeric --full-table --funcs-only --keys-only --compose-only --charset=charset ]

Write to standard output the current contents of the keyboard mapping tables. It is usually used to make backup files before doing potentially dangerous things to your settings.

Example: To dump the contents of the keyboard mapping file together with the action symbols and their numeric values, use

dumpkeys > keyfile.bak

Example: To generate a more readable (but not loadable) stream of dumpkey information, use

dumpkeys -l

-h --help

Display program version and usage information.

-i --short-info

Display the following information about the kernel's keyboard driver:

         Keycode range supported by the kernel

         Number of actions bindable to a key

         Ranges of action codes supported by the kernel

         Number of function keys supported by kernel

         Current function strings associated with a key

-l --long-info

Display the short-info information, a list of action symbols supported by loadkeys and dumpkeys, and the symbol's numeric values.

-n --numeric

Print the action code values in hexadecimal notation.

-f --full-table

First, output a list of all the current key modifiers. Then output a list of the actions associated with each possible key+modifier combination.

--funcs-only

Output only the function key definitions.

--keys-only

Output only the key bindings. (Do not include string definitions.)

--compose-only

Output only the compose key combinations.

-ccharset--charset=charset

Interpret character code values according to the specified character set.

getkeycodes

Print the kernel scancode-to-keycode mapping table.

Example: This command has no options.

getkeycodes

getty

[-d defaults_file] [-a] [-h] [-r delay] [-t timeout] [-w waitfor] line [speed [type [lined]]]

getty -c gettydefs_file

Get a tty. Monitor an input device for user activity and perform the initialization functions necessary to begin a login session. This sets terminal mode, communication speed, and line discipline; then it displays the login prompt and accepts the user name.

Getty first parses its command line for applicable options. It then scans the defaults file (usually /etc/conf.getty) for specified runtime values. Next it performs a line initialization, if specified. After initialization, the line is closed and reopened. It displays the login prompt and, upon reading a login name, invokes the login program.

Getty isn't really a user command; it's almost always run automatically by init. You can find the command line in /etc/inittab. There are several variations on getty (mingetty, mgetty, agetty) that perform roughly the same function, but are optimized for various hardware configurations.

Example: To monitor tty1 for user activity, use:

getty tty1

Defaults File

Getty looks for the file /etc/conf.getty.line (or /etc/conf.getty) and, if the file is found, uses it to set the following options:

Getty recognizes the following escape characters for use in the issue or login banner:

SYSTEM=name

Set the nodename value as specified.

VERSION=string

Set the version value to the specified string. If string begins with "/", it is assumed to be the path to a file specifying the VERSION value, /proc/version by default.

LOGIN=name

Specify the login program (/bin/login by default).

INIT=string

If defined, string is an expect/send sequence that is used to initialize the line before getty attempts to use it.

ISSUE=string

Specify the location of file containing or actual value of the "issue string" which is displayed on startup.

CLEAR=value

Specify whether or not to clear the screen before displaying the issue or login prompt (where value=[YES|NO]).

HANGUP=value

Specify whether or not to hang up the line during startup. (value=[YES|NO]).

WAITCHAR=value

If value=YES, getty will wait for a single character from its line before continuing.

DELAY=seconds

Force getty to wait the specified number of seconds after the WAITCHAR is accepted before continuing.

TIMEOUT=number

Force getty to exit if no user name is input before the specified number of seconds elapses.

CONNECT=string

If defined, specify an expect/send sequence used in establishing a connection.

WAITFOR=string

Specify a string of characters to be waited for before issuing a login prompt.

ALTLOCK=line

Tell getty to lock the device specified by line in addition to the device to which it is attached.

ALTLINE=line

Use the device specified by line to handle modem initialization.

RINGBACK=value

When value=YES, ringback calling is used.

SCHED=range1 range2 range3 ...

Specify a range of times in which logins are allowed. ranges are formatted as DOW:HR:MIN-DOW:HR:MIN.

OFF=string

Specify a string to be sent when the line is scheduled to be OFF.

FIDO=string

Specify the path to the FidoNet mailer.

EMSI=value

When value=yes, look for FidoNet EMSI sequences in the input.

 

\\

Backslash (\).

\b

Backspace (^H).

\c

Placed at the end of a string, this prevents a new-line from being entered after the string.

\f

Formfeed (^L).

\n

New line (^J).

\r

Carriage return (^M).

\s

A single space (" ").

\t

Horizontal tab (^I).

\nnn

Outputs the ASCII character whose decimal value is nnn.

Getty recognizes the following @char parameters and substitutes the listed value in any issue or login displays:

@B

The current (evaluated at the time the @B is seen) baud rate.

@D

The current date, in MM/DD/YY format.

@L

The line to which getty is attached.

@S

The system node name.

@T

The current time, in HH:MM:SS (24-hour).

@U

The number of currently signed-on users.

@V

The value of VERSION, as given in the defaults file.

kbd_mode [ -a / -u / -k / -s ]

kbd_mode either displays the current keyboard mode (RAW, MEDIUMRAW or XLATE) or, if one of the following options is used, modifies the keyboard mode as follows:

-s scancode mode (RAW).

-k keycode mode (MEDIUMRAW).

-a ASCII mode (XLATE).

-u UTF-8 mode (UNICODE).

kbdrate [ -s ] [ -rrate] [ -ddelay]

This command specifies changes to the repeat rate and delay time for IBM keyboards. If called with no options, kbdrate will reset the rate to 10.9 characters per second and the delay to 250 milliseconds.

-s

Run in silent mode(i.e.,display no messages).

-rrate

Specify a new character per second (cps) rate, where rate is one of: 2.0, 2.1, 2.3, 2.5, 2.7, 3.0, 3.3, 3.7, 4.0, 4.3, 4.6, 5.0, 5.5, 6.0, 6.7, 7.5, 8.0, 8.6, 9.2, 10.0, 10.9, 12.0, 13.3, 15.0, 16.0, 17.1, 18.5, 20.0, 21.8, 24.0, 26.7, 30.0.

-dmilliseconds

Specify the delay in milliseconds. Allowable values are: 250, 500, 750, 1000.

infocmp

[-dcnpILCuV1] [-v n] [-s d| i| l| c] [-w width] [-A directory] [-B directory] [termname ]

This command deals with terminfo entries. It either compares two specified entries, prints out a description, or sets new values.

Example: To generate source information for the vt100 terminfo entry, use

infocmp -C vt100

Example: To generate a list of the differences between a wy50 and a wy150 terminfo entry, use

infocmp -d wy50 wy150

-d

Generate a list of the differences between the two entries.

-c

Generate a list of the capabilities that the two entries have in common.

-n

Generate a list of the capabilities that neither entry has.

-I

Generate a source listing by terminfo name for each terminal named (this is the default).

-L

Generate a source listing by C variable name for each terminal named.

-C

Generate a source listing by termcap name for each terminal named. Output generated by this option may be used as a termcap entry, though the translation process is not perfect and may require some tweaking.

-r

Generate a source listing by termcap name, including capabilities in termcap form for each terminal named.

-s

Sort by one of the following:

d Retain the order the output fields were stored in the terminfo database.

i Sort by terminfo name.

l Sort by long C variable name.

c Sort by termcap name.

-1

Display fields one per line.

-F

Compare two terminfo files.

-Rsubset

Restrict output to the specified subset (SVr1 | Ultrix | HP | AIX | BSD).

-T

Do not restrict amount of text generated.

-V

Display version information.

-e

Output in the form of a C initializer for a TERMTYPE structure.

-f

Indent complex output strings.

-i

Analyze the initialization (is1, is2, is3), and reset (rs1, rs2, rs3), strings in the entry.

-p

Disregard padding when doing comparisons.

-v n

Output tracing information to standard error.

-w width

Display output in the specified width.

loadkeys

[-c --clearcompose] [-d --default ] [-h --help ] [-m --mktable ] [ -s --clearstrings ] [ -v --verbose ] [ filename ]

Read in the keymap for the kernel from the specified file.

Example: To read in the keymap generated in the dumpkeys example, use

loadkeys keyfile.bak

-d, --default

Load in a default keymap, usually /usr/lib/kbd/ keymaps or /usr/src/linux drivers/char.

-c, --clearcompose

Empty the kernel accent table.

-v, --verbose

Verbose output.

-s, --clearstrings

Clear the kernel string table.

-m, --mktable

Print to standard output a file formatted to be used as the specifier for default key bindings for the kernel. (Typically /usr/src/linux/ drivers/char/defkeymap.c.)

-h --help

Display help information.

login

[ name ]

login

-p

login

-h hostname

login

-f name

Login is the program that initiates user access onto the system.

Example: This is another one of those programs that usually isn't run by a human being. (Typically, it's called by getty.)

login

graphics/tip.gif

If you have a multi-user system and want to keep people from logging on for a while, create a file called /etc/nologin

 

-p

Tell login to preserve the current environment.

-f

Do not do a second login authentication.

-h

Used by other servers to pass the name of the remote host to login so that it may be placed in utmp and wtmp.

setterm

[ -term terminal_name ]

setterm

[ -reset ]

setterm

[ -initialize ]

setterm

[ -cursor [on|off] ]

setterm

[ -keyboard pc|olivetti|dutch|extended ]

setterm

[ -repeat [on|off] ]

setterm

[ -appcursorkeys [on|off] ]

setterm

[ -linewrap [on|off] ]

setterm

[ -snow [on|off] ]

setterm

[ -softscroll [on|off] ]

setterm

[ -defaults ]

setterm

[ -foreground black|red|green|yellow|blue|magenta|cyan|white|default ]

setterm

[ -background black|red|green|yellow|blue|magenta|cyan|white|default ]

setterm

[ -ulcolor black|grey|red|green|yellow|blue|magenta|cyan|white ]

setterm

[ -ulcolor bright red|green|yellow|blue|magenta|cyan|white ]

setterm

[ -hbcolor black|grey|red|green|yellow|blue|magenta|cyan|white ]

setterm

[ -hbcolor bright red|greenyellow|blue|magenta|cyan|white ]

setterm

[ -inversescreen [on|off] ]

setterm

[ -bold [on|off] ]

setterm

[ -half-bright [on|off] ]

setterm

[ -blink [on|off] ]

setterm

[ -reverse [on|off] ]

setterm

[ -underline [on|off] ]

setterm

[ -store ]

setterm

[ -clear [ all|rest ] ]

setterm

[ -tabs [tab1 tab2 tab3 ] ] where (tabn = 1-160)

setterm

[ -clrtabs [ tab1 tab2 tab3 ] where (tabn = 1-160)

setterm

[ -regtabs [ 1-160 ] ]

setterm

[ -blank [ 0-60 ] ]

setterm

[ -powersave [ on|vsync|hsync|powerdown|off ] ]

setterm

[ -powerdown [ 0-60 ] ]

setterm

[ -dump [ 1-NR_CONS ] ]

setterm

[ -append [ 1-NR_CONS ] ]

setterm

[ -file dumpfilename ]

setterm

[ -standout [ attr ] ]

setterm

[ -blength [ 0-2000 ] ]

setterm

[ -bfreq freqnumber ]

This command displays to standard output a character string that will set the specified terminal capabilities. Most of the options are self-explanatory.

Example: To set your terminal keyboard type as Olivetti, use

setterm -keyboard olivetti

-term

Use to override the TERM environment variable.

-reset

Display terminal reset string.

-initialize

Display the current terminal initialization string.

-default

Reset the display options to their default values.

-store

Store the current display options as the default.

stty

[SETTING]

stty

[OPTION]

If invoked with no options, stty displays the baud rate, line discipline number, and line settings that differ from those of "stty sane". If invoked with options, it will display or set one or more specified values.

Control Key

stty Name

Function

<Ctrl>-\

quit

More enthusiastic version of ^C.

<Ctrl>-?, <Del>

erase

Erase last character.

<Ctrl>-C

intr

Stop running program.

<Ctrl>-D

eof

Signal end of input.

<Ctrl>-Q

 

Restart output to screen.

<Ctrl>-S

stop

Stop output to screen.

<Ctrl>-U

kill

Erase command line.

<Ctrl>-Z

susp

Suspend executing command.

Example: If you really messed up your stty values and you want things back in a reasonable configuration, enter

stty sane

-a, --all

Display all current settings in human readable form.

-g, --save

Display all current settings formatted to be usable as an argument to another stty command which will restore current settings.

Control Settings

parenb

Tell stty to generate a parity bit in output and expect a parity bit in input. May be negated.

parodd

Tell stty to set odd parity (even if negated) (negatable).

cs5, cs6, cs7, cs8

Tell stty to set character size to 5, 6, 7, or 8 bits.

hup, hupcl

Tell stty to send a hangup signal when the last process closes the tty. May be negated.

cstopb

Tell stty to use two stop bits per character (one if negated) (negatable).

cread

Tell stty to allow input to be received (negatable).

clocal

Tell stty to disable modem control signals (negatable).

crtscts

Tell stty to enable RTS/CTS flow control (negatable).

Input Settings

ignbrk

Tell stty to ignore break characters (negatable).

brkint

Tell stty to make breaks cause an interrupt signal. (negatable).

ignpar

Tell stty to ignore characters with parity errors (negatable).

parmrk

Tell stty to mark parity errors (with a 255-0-character sequence). May be negated.

inpck

Enable input parity checking. Negatable.

istrip

Clear high (8th) bit of input characters (negatable).

inlcr

Translate newline to carriage return (negatable).

igncr

Tell stty to ignore carriage return (negatable).

icrnl

Translate carriage return to newline (negatable).

ixon

Enable XON/XOFF flow control (that is, "CTRL-S'/`CTRL-Q"). May be negated.

ixoff, tandem

Enable sending of "stop" character when the system input buffer is almost full, and "start" character when it becomes almost empty again (negatable).

iuclc

This option translates uppercase characters to lowercase. It may be negated.

ixany

This option tells stty to allow any character to restart output. If negated, only the start character can restart output.

imaxbel

If a character arrives when the input buffer is full, this option tells stty to beep but not flush the input buffer.

Output Settings

opost

Postprocess output (negatable).

olcuc

Translate lowercase characters to uppercase (negatable).

ocrnl

Translate carriage return to newline (negatable).

onlcr

Translate newline to carriage return-newline (negatable).

onocr

No carriage returns in the first column (negatable).

onlret

Tell stty that newline will also perform a carriage return.

ofill

Tell stty to implement delays with padding characters rather than via timing (negatable).

ofdel

Specify use of delete characters for fill instead of null characters (negatable).

nl1, nl0

Specify a newline delay style.

cr3, cr2, cr1, cr0

Specify a carriage return delay style.

tab3, tab2, tab1, tab0

Specify a horizontal tab delay style.

bs1, bs0

Specify a backspace delay style.

vt1, vt0

Specify a vertical tab delay style.

ff1, ff0

Specify a form feed delay style.

Local Settings

isig

This option enables the "interrupt", "quit", and "suspend" special characters (negatable).

icanon

Enable "erase", "kill", "werase", and "rprnt" special characters (negatable).

iexten

Enable non-POSIX special characters (negatable).

echo

Echo input characters (negatable).

echoe, crterase

Tell stty to echo "erase" characters as backspace-space-backspace (negatable).

echok

Tell stty to echo a newline after a "kill" character (negatable).

echonl

Echo newline even if not echoing other characters. (negatable).

noflsh

Disable flushing after "quit" and "interrupt" special characters (negatable).

xcase

Enable input and output of uppercase characters by preceding their lowercase equivalents with "\", when "icanon" is set (negatable).

tostop

Halt background jobs that try to write to the terminal (negatable).

echoprt, prterase

Tell stty to echo erased characters backward, between "\" and "/" (negatable).

echoctl, ctlecho

Control characters output in hat notation ("^C") instead of literally (negatable).

echoke, crtkill

Echo the "kill" special character by erasing each character on the line as indicated by the "echoprt" and "echoe" settings, instead of by the "echoctl" and "echok" settings (negatable).

Combination Settings

evenp, parity

Equivalent to "parenb -parodd cs7". If negated, it is same as "-parenb cs8".

oddp

Equivalent to "parenb parodd cs7". If negated, it is the same as "-parenb cs8".

nl

Equivalent to "-icrnl -onlcr". If negated, it is the same as "icrnl -inlcr -igncr onlcr -ocrnl -onlret".

ek

Reset the "erase" and "kill" special characters to their default values.

sane

Equivalent to 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 and also sets all special characters to their default values.

cooked

Equivalent to "brkint ignpar istrip icrnl ixon opost isig icanon", plus, it sets the "eof" and "eol" characters to their default values if they are the same as the "min" and "time" characters. If negated, it is the same as "raw".

raw

Equivalent to -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon-xcase min 1 time 0. If negated, it is same as "cooked".

cbreak

Equivalent to "-icanon". Negatable. If negated, it is the same as "icanon".

pass8

Equivalent to "-parenb -istrip cs8". If negated, it is the same as "parenb istrip cs7".

litout

Equivalent to "-parenb -istrip -opost cs8". If negated, it is the same as "parenb istrip opost cs7".

decctlq

Equivalent to "-ixany" (negatable).

tabs

Equivalent to "tab0". If negated, it is the same as "tab3".

lcase LCASE

Equivalent to "xcase iuclc olcuc" (negatable).

crt

Equivalent to "echoe echoctl echoke".

dec

Equivalent to "echoe echoctl echoke -ixany intr ^C erase ^? kill C-u".

Special Characters

The default values of special characters are system-specific. They are set with the syntax "name value", where the value can be given in hat notation (e.g., "^C"), literally, or as an integer (precede with 0x for hexadecimal ).

intr

Interrupt signal.

quit

Quit signal.

erase

Erase the last character typed.

kill

Erase the current line.

eof

Terminate input (a.k.a. end of file).

eol

End the line.

eol2

Alternate character to end the line.

swtch

Switch to a different shell layer.

start

Restart the output after stopping it.

stop

Stop the output.

susp

Send a terminal stop signal.

dsusp

Send a terminal stop signal after flushing the input.

rprnt

Redraw the current line.

werase

Erase the last word typed.

lnext

Enter the next character typed literally, even if it is a special character.

Special Settings

minN

Specify the minimum number of characters that will satisfy a read until the time value has expired, at which point "-icanon" is set.

timeN

Specify the number of tenths of a second before reads time out if the minimum number of characters have not been read, when "-icanon" is set.

ispeedN

Specify an input speed of N.

ospeedN

Specify an output speed of N.

rowsN

Define the number of rows to the tty kernel driver.

colsN, columnsN

Define the number of columns to the tty kernel driver.

size

Display the number of rows and columns that the kernel thinks the terminal has.

lineN

Specify a line discipline to use.

speed

Print the terminal speed.

N

Tell stty to use the specified input and output speed: N can be one of: 0 50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 "exta" "extb". "exta" is the same as 19200; "extb" is the same as 38400. 0 hangs up the line if "-clocal" is set.

tic

[-1CINRTcfrs] [-e names] [-o dir] [-v[n]] [-w[n]] file

Compile the specified source file into a terminfo database entry. By default, output goes to /usr/share/erminfo.

Example: To compile the file obscure into a terminfo entry:

tic obscure

-c

Check only for errors in source file.

-vn

Specify a level of verbose debugging information from 1 to 10. (Detail increases with n.)

-odir

Specify a target directory for output.

-wn

Specify width of output.

-1

Make output width one column.

-C

Translate source to termcap format.

-I

Translate source to terminfo format.

-L

Force source translation to terminfo format using the long C variable names listed in <term.h>

-N

Disable smart defaults.

-Rsubset

Restrict output to a given subset.

-T

Allow output to be of any size.

-r

Force entry resolution even when translating to termcap format.

-elist

Limit the affected terminal types to those in the (comma separated) specified list.

-f

Format complex output by indenting.

-s

Output summary information about the results of the compile.

file

Source file.

tput

[-Ttype] capname [parms ]

tput

[-Ttype] init

tput

[-Ttype] reset

tput

[-Ttype] longname

tput

-S <<

This command may be used to display or set the values of variables which correspond to terminal capabilities as specified in terminfo.

Example: To initialize the current terminal, use

tput init

-Ttype

Specify type of terminal.

capname

Indicate a specific terminfo attribute for processing.

parms

If the attribute is a string that takes parameters, the arguments parms will be instantiated into the string. An all-numeric argument will be passed to the attribute as a number.

-S

This option allows you to specify more than one value per invocation of tput. If this option is used, tput becomes interactive and further options are entered via standard input.

init

This option causes tput to attempt the following: (1) output terminal initialization strings as specified in terminfo, (2) reset tty driver, and (3) set tabs.

reset

Output terminal's reset (rather than initialization) strings.

longname

Display the long name of the current terminal as specified in terminfo.

tset

[-IQqrs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]

reset

[-IQqrs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]

This command is used to initialize terminals. It first decides what type of terminal you are using through one of three methods:

1.       Terminal type is specified on command line.

2.       If not, checks the TERM environment variable.

3.       Uses the default type, "unknown".

The command is somewhat interactive. For example, it prompts the user to confirm its guesswork regarding terminal type. Once it has settled on a terminal type, it uses that information to set a bewildering variety of display options (window size, erase character, interrupt )

Example: To display your terminal initialization shell commands to standard output, use

tset -s

-q

Display terminal type but alter nothing.

-e

Set the erase character as specified.

-I

Do not send terminal or tab initialization strings.

-i

Set the interrupt character as specified.

-k

Set the line kill character as specified.

-m

Specify a mapping from a port type to a terminal.

-Q

Suppress display for line kill, erase, and interrupt characters.

-r

Output terminal type to standard error.

-s

Output the shell commands needed to initialize the TERM environment variable.

 



Linux Desk Reference
Linux Desk Reference (2nd Edition)
ISBN: 0130619892
EAN: 2147483647
Year: 2000
Pages: 174
Authors: Scott Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net