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.
pwd: Print working directory
pwd prints the fully resolved name of the current directory.
That is, all components of the printed name will be actual directory
names--none will be symbolic links.
Because most shells have a built-in command by the same name, using the unadorned command name in a script or interactively may get you different functionality than that described here.
The only options are a lone `--help' or `--version'. See section Common options.
stty: Print or change terminal characteristics
If given no arguments, 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'.
Mode reading and setting are performed on the tty line connected to
standard input.
stty accepts many non-option arguments that change aspects of
the terminal line operation, as described below.
Synopses:
stty [ setting ]... stty [ option ]
The program accepts the following options. Also see section Common options.
stty command to restore the current 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.
stop character when the system input buffer
is almost full, and start character when it becomes almost
empty again. May be negated.
These arguments specify output-related operations.
interrupt, quit, and suspend special
characters. May be negated.
erase, kill, werase, and rprnt
special characters. May be negated.
erase characters as backspace-space-backspace. May be
negated.
kill character. May be negated.
interrupt and quit special
characters. May be negated.
icanon is set.
Non-POSIX. May be negated.
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.
parenb -parodd cs7. May be negated. If negated, same
as -parenb cs8.
parenb parodd cs7. May be negated. If negated, same
as -parenb cs8.
-icrnl -onlcr. May be negated. If negated, same as
icrnl -inlcr -igncr onlcr -ocrnl -onlret.
erase and kill special characters to their default
values.
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 echokeand also sets all special characters to their default values.
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.
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon -xcase min 1 time 0May be negated. If negated, same as
cooked.
-icanon. May be negated. If negated, same as
icanon.
-parenb -istrip cs8. May be negated. If negated,
same as parenb istrip cs7.
-parenb -istrip -opost cs8. May be negated.
If negated, same as parenb istrip opost cs7.
-ixany. Non-POSIX. May be negated.
tab0. Non-POSIX. May be negated. If negated, same
as tab3.
xcase iuclc olcuc. Non-POSIX. May be negated.
echoe echoctl echoke.
echoe echoctl echoke -ixany intr ^C erase ^? kill C-u.
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.)
-icanon is set.
-icanon is set.
LINES and COLUMNS
instead; however, GNU stty does not know anything about them.)
Non-POSIX.
exta extb. exta is the same as
19200; extb is the same as 38400. 0 hangs up the line if
-clocal is set.
printenv: Print all or some environment variablesSynopsis:
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 only options are a lone `--help' or `--version'. See section Common options.
0 if all variables specified were found 1 if at least one specified variable was not found 2 if a write error occurred
tty: Print file name of terminal on standard input
tty prints the file name of the tty connected to its standard
input. It prints `not a tty' if standard input is not a tty.
Synopsis:
tty [ option ]...
The program accepts the following option. Also see section Common options.
0 if standard input is a tty 1 if standard input is not a tty 2 if given incorrect arguments 3 if a write error occurs