| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes commands that display or alter the context in which you are working: the current directory, the terminal settings, and so forth. See also the user-related commands in the next section.
19.1 pwd: Print working directory | Print working directory. | |
19.2 stty: Print or change terminal characteristics | Print or change terminal characteristics. | |
19.3 printenv: Print all or some environment variables | Print environment variables. | |
19.4 tty: Print file name of terminal on standard input | Print file name of terminal on standard input. |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
pwd: Print working directory pwd prints the name of the current directory. Synopsis:
pwd [option]… |
The program accepts the following options. Also see Common options.
If the contents of the environment variable PWD provide an
absolute name of the current directory with no `.' or `..'
components, but possibly with symbolic links, then output those
contents. Otherwise, fall back to default `-P' handling.
Print a fully resolved name for the current directory. That is, all components of the printed name will be actual directory names--none will be symbolic links.
If `-L' and `-P' are both given, the last one takes
precedence. If neither option is given, then this implementation uses
`-P' as the default unless the POSIXLY_CORRECT
environment variable is set.
Due to shell aliases and built-in pwd command, using an
unadorned pwd interactively or in a script may get you
different functionality than that described here. Invoke it via
env (i.e., env pwd …) to avoid interference
from the shell.
An exit status of zero indicates success, and a nonzero value indicates failure.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
stty: Print or change terminal characteristics stty prints or changes terminal characteristics, such as baud rate.
Synopses:
stty [option] [setting]… stty [option] |
If given no line settings, stty prints the baud rate, line
discipline number (on systems that support it), and line settings
that have been changed from the values set by `stty sane'.
By default, mode reading and setting are performed on the tty line
connected to standard input, although this can be modified by the
`--file' option.
stty accepts many non-option arguments that change aspects of
the terminal line operation, as described below.
The program accepts the following options. Also see Common options.
Print all current settings in human-readable form. This option may not be used in combination with any line settings.
Set the line opened by the file name specified in device instead of
the tty line connected to standard input. This option is necessary
because opening a POSIX tty requires use of the O_NONDELAY flag to
prevent a POSIX tty from blocking until the carrier detect line is high if
the clocal flag is not set. Hence, it is not always possible
to allow the shell to open the device in the traditional manner.
Print all current settings in a form that can be used as an argument to
another stty command to restore the current settings. This option
may not be used in combination with any line settings.
Many settings can be turned off by preceding them with a `-'. Such arguments are marked below with "May be negated" in their description. The descriptions themselves refer to the positive case, that is, when not negated (unless stated otherwise, of course).
Some settings are not available on all POSIX systems, since they use extensions. Such arguments are marked below with "Non-POSIX" in their description. On non-POSIX systems, those or other settings also may not be available, but it's not feasible to document all the variations: just try it and see.
An exit status of zero indicates success, and a nonzero value indicates failure.
| 19.2.1 Control settings | ||
| 19.2.2 Input settings | ||
| 19.2.3 Output settings | ||
| 19.2.4 Local settings | ||
| 19.2.5 Combination settings | ||
| 19.2.6 Special characters | ||
| 19.2.7 Special settings |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Control settings:
Generate parity bit in output and expect parity bit in input. May be negated.
Set odd parity (even if negated). May be negated.
Set character size to 5, 6, 7, or 8 bits.
Send a hangup signal when the last process closes the tty. May be negated.
Use two stop bits per character (one if negated). May be negated.
Allow input to be received. May be negated.
Disable modem control signals. May be negated.
Enable RTS/CTS flow control. Non-POSIX. May be negated.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These settings control operations on data received from the terminal.
Ignore break characters. May be negated.
Make breaks cause an interrupt signal. May be negated.
Ignore characters with parity errors. May be negated.
Mark parity errors (with a 255-0-character sequence). May be negated.
Enable input parity checking. May be negated.
Clear high (8th) bit of input characters. May be negated.
Translate newline to carriage return. May be negated.
Ignore carriage return. May be negated.
Translate carriage return to newline. May be negated.
Assume input characters are UTF-8 encoded. May be negated.
Enable XON/XOFF flow control (that is, CTRL-S/CTRL-Q). May be negated.
Enable sending of stop character when the system input buffer
is almost full, and start character when it becomes almost
empty again. May be negated.
Translate uppercase characters to lowercase. Non-POSIX. May be negated. Note ilcuc is not implemented, as one would not be able to issue almost any (lowercase) Unix command, after invoking it.
Allow any character to restart output (only the start character if negated). Non-POSIX. May be negated.
Enable beeping and not flushing input buffer if a character arrives when the input buffer is full. Non-POSIX. May be negated.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These settings control operations on data sent to the terminal.
Postprocess output. May be negated.
Translate lowercase characters to uppercase. Non-POSIX. May be negated. (Note ouclc is not currently implemented.)
Translate carriage return to newline. Non-POSIX. May be negated.
Translate newline to carriage return-newline. Non-POSIX. May be negated.
Do not print carriage returns in the first column. Non-POSIX. May be negated.
Newline performs a carriage return. Non-POSIX. May be negated.
Use fill (padding) characters instead of timing for delays. Non-POSIX. May be negated.
Use ASCII DEL characters for fill instead of ASCII NUL characters. Non-POSIX. May be negated.
Newline delay style. Non-POSIX.
Carriage return delay style. Non-POSIX.
Horizontal tab delay style. Non-POSIX.
Backspace delay style. Non-POSIX.
Vertical tab delay style. Non-POSIX.
Form feed delay style. Non-POSIX.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Enable interrupt, quit, and suspend special
characters. May be negated.
Enable erase, kill, werase, and rprnt
special characters. May be negated.
Enable non-POSIX special characters. May be negated.
Echo input characters. May be negated.
Echo erase characters as backspace-space-backspace. May be
negated.
Echo a newline after a kill character. May be negated.
Echo newline even if not echoing other characters. May be negated.
Disable flushing after interrupt and quit special
characters. May be negated.
Enable input and output of uppercase characters by preceding their
lowercase equivalents with `\', when icanon is set.
Non-POSIX. May be negated.
Stop background jobs that try to write to the terminal. Non-POSIX. May be negated.
Echo erased characters backward, between `\' and `/'. Non-POSIX. May be negated.
Echo control characters in hat notation (`^c') instead of literally. Non-POSIX. May be negated.
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. Non-POSIX.
May be negated.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Combination settings:
Same as parenb -parodd cs7. May be negated. If negated, same
as -parenb cs8.
Same as parenb parodd cs7. May be negated. If negated, same
as -parenb cs8.
Same as -icrnl -onlcr. May be negated. If negated, same as
icrnl -inlcr -igncr onlcr -ocrnl -onlret.
Reset the erase and kill special characters to their default
values.
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 |
and also sets all special characters to their default values.
Same as brkint ignpar istrip icrnl ixon opost isig icanon, plus
sets the eof and eol characters to their default values
if they are the same as the min and time characters.
May be negated. If negated, same as 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 |
May be negated. If negated, same as cooked.
Same as `-icanon'. May be negated. If negated, same as
icanon.
Same as -parenb -istrip cs8. May be negated. If negated,
same as parenb istrip cs7.
Same as `-parenb -istrip -opost cs8'. May be negated.
If negated, same as parenb istrip opost cs7.
Same as `-ixany'. Non-POSIX. May be negated.
Same as tab0. Non-POSIX. May be negated. If negated, same
as tab3.
Same as xcase iuclc olcuc. Non-POSIX. May be negated.
(Used for terminals with uppercase characters only.)
Same as echoe echoctl echoke.
Same as echoe echoctl echoke -ixany intr ^C erase ^? kill C-u.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The special characters' default values vary from system to system. They are set with the syntax `name value', where the names are listed below and the value can be given either literally, in hat notation (`^c'), or as an integer which may start with `0x' to indicate hexadecimal, `0' to indicate octal, or any other digit to indicate decimal.
For GNU stty, giving a value of ^- or undef disables that
special character. (This is incompatible with Ultrix stty,
which uses a value of `u' to disable a special character. GNU
stty treats a value `u' like any other, namely to set that
special character to U.)
Send an interrupt signal.
Send a quit signal.
Erase the last character typed.
Erase the current line.
Send an end of file (terminate the input).
End the line.
Alternate character to end the line. Non-POSIX.
Switch to a different shell layer. Non-POSIX.
Restart the output after stopping it.
Stop the output.
Send a terminal stop signal.
Send a terminal stop signal after flushing the input. Non-POSIX.
Redraw the current line. Non-POSIX.
Erase the last word typed. Non-POSIX.
Enter the next character typed literally, even if it is a special character. Non-POSIX.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Set the minimum number of characters that will satisfy a read until the time value has expired, when `-icanon' is set.
Set 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.
Set the input speed to n.
Set the output speed to n.
Tell the tty kernel driver that the terminal has n rows. Non-POSIX.
Tell the kernel that the terminal has n columns. Non-POSIX.
Print the number of rows and columns that the kernel thinks the
terminal has. (Systems that don't support rows and columns in the kernel
typically use the environment variables LINES and COLUMNS
instead; however, GNU stty does not know anything about them.)
Non-POSIX.
Use line discipline n. Non-POSIX.
Print the terminal speed.
Set the input and output speeds to n. 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. Many systems, including GNU/Linux,
support higher speeds. The stty command includes support
for speeds of
57600,
115200,
230400,
460800,
500000,
576000,
921600,
1000000,
1152000,
1500000,
2000000,
2500000,
3000000,
3500000,
or
4000000 where the system supports these.
0 hangs up the line if `-clocal' is set.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
printenv: Print all or some environment variables printenv prints environment variable values. Synopsis:
printenv [option] [variable]… |
If no variables are specified, printenv prints the value of
every environment variable. Otherwise, it prints the value of each
variable that is set, and nothing for those that are not set.
The program accepts the following option. Also see Common options.
Output a zero byte (ASCII NUL) at the end of each line,
rather than a newline. This option enables other programs to parse the
output of printenv even when that output would contain data
with embedded newlines.
Exit status:
0 if all variables specified were found 1 if at least one specified variable was not found 2 if a write error occurred |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
tty: Print file name of terminal on standard input tty prints the file name of the terminal connected to its standard
input. It prints `not a tty' if standard input is not a terminal.
Synopsis:
tty [option]… |
The program accepts the following option. Also see Common options.
Print nothing; only return an exit status.
Exit status:
0 if standard input is a terminal 1 if standard input is not a terminal 2 if given incorrect arguments 3 if a write error occurs |
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on January, 20 2010 using texi2html 1.76.