START-INFO-DIR-ENTRY
* Shell utilities: (sh-utils).	GNU shell utilities.
* basename: (sh-utils)basename invocation.	Strip directory and suffix.
* date: (sh-utils)date invocation.	Print/set system date and time.
* dirname: (sh-utils)dirname invocation.	Strip non-directory suffix.
* echo: (sh-utils)echo invocation.	Print a line of text.
* env: (sh-utils)env invocation.	Modify the environment.
* expr: (sh-utils)expr invocation.	Evaluate expressions.
* false: (sh-utils)false invocation.	Do nothing, unsuccessfully.
* groups: (sh-utils)groups invocation.	Print group names a user is in.
* hostname: (sh-utils)hostname invocation.	Print or set system name.
* id: (sh-utils)id invocation.	Print real/effective uid/gid.
* logname: (sh-utils)logname invocation.	Print current login name.
* nice: (sh-utils)nice invocation.	Modify scheduling priority.
* pathchk: (sh-utils)pathchk invocation.	Check file name portability.
* printenv: (sh-utils)printenv invocation.	Print environment variables.
* printf: (sh-utils)printf invocation.	        Format and print data.
* pwd: (sh-utils)pwd invocation.	        Print working directory.
* sleep: (sh-utils)sleep invocation.	        Delay for a specified time.
* stty: (sh-utils)stty invocation.	        Print/change terminal settings.
* su: (sh-utils)su invocation.	                Modify user and group id.
* tee: (sh-utils)tee invocation.	        Redirect to multiple files.
* test: (sh-utils)test invocation.	        File/string tests.
* true: (sh-utils)true invocation.	        Do nothing, successfully.
* tty: (sh-utils)tty invocation.	        Print terminal name.
* uname: (sh-utils)uname invocation.	        Print system information.
* users: (sh-utils)users invocation.	        Print current user names.
* who: (sh-utils)who invocation.	        Print who is logged in.
* whoami: (sh-utils)whoami invocation.	Print effective user id.
* yes: (sh-utils)yes invocation.	Print a string indefinitely.
END-INFO-DIR-ENTRY

This file documents the GNU shell utilities.

Copyright (C) 1994 Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.


GNU shell utilities
Node: Top, Next: Introduction, Prev: , Up: (dir)

GNU shell utilities

This manual minimally documents version GNU sh-utils 1.12 of the GNU shell utilities.

* Menu:

Introduction	Caveats, overview, and authors.

Common options	Common options.

Printing text	echo printf yes

Conditions	false true test expr

Redirection	tee

File name manipulation	dirname basename pathchk

Working context information	pwd stty printenv tty

User information	id logname whoami groups users who

System context	date uname hostname

Modified command invocation	env nice nohup su

Delaying	sleep

Index	General index.


Introduction
Node: Introduction, Next: Common options, Prev: Top, Up: Top

Introduction

First of all, this manual is incomplete.  The stty section, in particular, needs substantial reorganization and additional explanatory text before it will be up to the standard of other GNU manuals.  Explanatory text in general is lacking; the manual presently assumes you pretty much know what to do, and just need to be reminded of how.  Thus, if you are interested, please get involved in improving this manual.  The entire GNU community will benefit.

Some of these programs are useful only when writing shell scripts; utilities like these are, in fact, the "language" of shell scripts (to a great extent).  Others are occasionally useful interactively.

The GNU shell utilities are mostly compatible with the POSIX.2 standard.

Please report bugs to 'bug-gnu-utils@prep.ai.mit.edu'.  Remember to include the version number, machine architecture, input files, and any other information needed to reproduce the bug.  See Bugs.

This manual is based on the Unix man pages in the distribution, which were originally written by David MacKenzie and updated by Jim Meyering.   Franc,ois Pinard did the initial conversion to Texinfo format.  Karl Berry did the indexing, some reorganization, and editing of the results.  Richard Stallman contributed his usual invaluable insights to the overall process.


Common options
Node: Common options, Next: Printing text, Prev: Introduction, Up: Top

Common options

Certain options are available in all these programs.  Rather than writing identical descriptions for each of the programs, they are described here.  (In fact, every GNU program accepts (or should accept) these options.)

Many of these programs take arbitrary strings as arguments.  In those cases, '--help' and '--version' are taken as these options only if there is one and exactly one command line argument.

'--help'

Print a usage message listing all available options, then exit successfully.

'--version'

Print the version number, then exit successfully.


Printing text
Node: Printing text, Next: Conditions, Prev: Common options, Up: Top

Printing text

This section describes commands that display text strings.

* Menu:

echo invocation	Print a line of text.

printf invocation	Format and print data.

yes invocation	Print a string until interrupted.


echo: Print a line of text
Node: echo invocation, Next: printf invocation, Prev: , Up: Printing text

echo: Print a line of text

Synopsis:

echo [ option ]... [ string ]...

echo writes each given string to standard output, with a space between each and a newline after the last one.

The program accepts the following options.  Also see See Common options.

'-n'

Do not output the trailing newline.

'-e'

Enable interpretation of the following backslash-escaped characters in each string:

'\a'

alert (bell)

'\b'

backspace

'\c'

suppress trailing newline

'\f'

form feed

'\n'

new line

'\r'

carriage return

'\t'

horizontal tab

'\v'

vertical tab

'\\'

backslash

'\nnn'

the character whose ASCII code is nnn (octal); if nnn is not a valid octal number, it is printed literally.


printf: Format and print data
Node: printf invocation, Next: yes invocation, Prev: echo invocation, Up: Printing text

printf: Format and print data

Synopsis:

printf format [ argument ]...

printf prints the format string, interpreting '%' directives and '\' escapes in the same way as the C printf function.  The format argument is re-used as necessary to convert all of the given arguments.

printf has one additional directive, '%b', which prints its argument string with '\' escapes interpreted in the same way as in the format string.

printf interprets '\0ooo' in format as an octal number (if ooo is 0 to 3 octal digits) specifying a character to print, and '\xhhh' as a hexadecimal number (if hhh is 1 to 3 hex digits) specifying a character to print.

An additional escape, '\c', causes printf to produce no further output.

The only options are a lone '--help' or '--version'.  See Common options.


yes: Print a string until interrupted
Node: yes invocation, Next: , Prev: printf invocation, Up: Printing text

yes: Print a string until interrupted

yes prints the command line arguments, separated by spaces and followed by a newline, forever until it is killed.  If no arguments are given, it prints 'y' followed by a newline forever until killed.

The only options are a lone '--help' or '--version'.  See Common options.


Conditions
Node: Conditions, Next: Redirection, Prev: Printing text, Up: Top

Conditions

This section describes commands that are primarily useful for their exit status, rather than their output.  Thus, they are often used as the condition of shell if statements, or as the last command in a pipeline.

* Menu:

false invocation	Do nothing, unsuccessfully.

true invocation	Do nothing, successfully.

test invocation	Check file types and compare values.

expr invocation	Evaluate expressions.


false: Do nothing, unsuccessfully
Node: false invocation, Next: true invocation, Prev: , Up: Conditions

false: Do nothing, unsuccessfully

false does nothing except return an exit status of 1, meaning "failure".  It can be used as a place holder in shell scripts where an unsuccessful command is needed.

Any arguments are ignored, except for a lone '--help' or '--version' (see Common options).


true: Do nothing, successfully
Node: true invocation, Next: test invocation, Prev: false invocation, Up: Conditions

true: Do nothing, successfully

true does nothing except return an exit status of 0, meaning "success".  It can be used as a place holder in shell scripts where a successful command is needed, although the shell built-in command : (colon) may be faster.

Any arguments are ignored, except for a lone '--help' or '--version' (see Common options).


test: Check file types and compare values
Node: test invocation, Next: expr invocation, Prev: true invocation, Up: Conditions

test: Check file types and compare values

test returns a status of 0 (true) or 1 (false) depending on the evaluation of the conditional expression expr.  Each part of the expression must be a separate argument.

test has file status checks, string operators, and numeric comparison operators.

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.

Besides the options below, test accepts a lone '--help' or '--version'.  See Common options.  A single non-option argument is also allowed: test returns true if the argument is not null.

* Menu:

File type tests	-[bcdfhLpSt]

Access permission tests	-[gkruwxOG]

File characteristics tests	-e -s -nt -ot -ef

String tests	-z -n = !=

Numeric tests	-eq -ne -lt -le -gt -ge

Connectives for test	! -a -o


File type tests
Node: File type tests, Next: Access permission tests, Prev: , Up: test invocation

File type tests

These options test for particular types of files.  (Everything's a file, but not all files are the same!)

'-b file'

True if file exists and is a block special device.

'-c file'

True if file exists and is a character special device.

'-d file'

True if file exists and is a directory.

'-f file'

True if file exists and is a regular file.

'-h file'

'-L file'

True if file exists and is a symbolic link.

'-p file'

True if file exists and is a named pipe.

'-S file'

True if file exists and is a socket.

'-t [ fd ]'

True if fd is opened on a terminal.  If fd is omitted, it defaults to 1 (standard output).


Access permission tests
Node: Access permission tests, Next: File characteristics tests, Prev: File type tests, Up: test invocation

Access permission tests

These options test for particular access permissions.

'-g file'

True if file exists and has its set-group-id bit set.

'-k file'

True if file has its "sticky" bit set.

'-r file'

True if file exists and is readable.

'-u file'

True if file exists and has its set-user-id bit set.

'-w file'

True if file exists and is writable.

'-x file'

True if file exists and is executable.

'-O file'

True if file exists and is owned by the current effective user id.

'-G file'

True if file exists and is owned by the current effective group id.


File characteristics tests
Node: File characteristics tests, Next: String tests, Prev: Access permission tests, Up: test invocation

File characteristics tests

These options test other file characteristics.

'-e file'

True if file exists.

'-s file'

True if file exists and has a size greater than zero.

'file1 -nt file2'

True if file1 is newer (according to modification date) than file2.

'file1 -ot file2'

True if file1 is older (according to modification date) than file2.

'file1 -ef file2'

True if file1 and file2 have the same device and inode numbers, i.e., if they are hard links to each other.


String tests
Node: String tests, Next: Numeric tests, Prev: File characteristics tests, Up: test invocation

String tests

These options test string characteristics.  Strings are not quoted for test, though you may need to quote them to protect characters with special meaning to the shell, e.g., spaces.

'-z string'

True if the length of string is zero.

'-n string'

'string'

True if the length of string is non-zero.

'string1 = string2'

True if the strings are equal.

'string1 != string2'

True if the strings are not equal.


Numeric tests
Node: Numeric tests, Next: Connectives for test, Prev: String tests, Up: test invocation

Numeric tests

Numeric relationals.  The arguments must be entirely numeric (possibly negative), or the special expression -l string, which evaluates to the length of string.

'arg1 -eq arg2'

'arg1 -ne arg2'

'arg1 -lt arg2'

'arg1 -le arg2'

'arg1 -gt arg2'

'arg1 -ge arg2'

These arithmetic binary operators return true if arg1 is equal, not-equal, less-than, less-than-or-equal, greater-than, or greater-than-or-equal than arg2, respectively.

For example:

test -1 -gt -2 && echo yes
=> yes
test -l abc -gt 1 && echo yes
=> yes
test 0x100 -eq 1
error--> test: integer expression expected before -eq


Connectives for test
Node: Connectives for test, Next: , Prev: Numeric tests, Up: test invocation

Connectives for test

The usual logical connectives.

'! expr'

True if expr is false.

'expr1 -a expr2'

True if both expr1 and expr2 are true.

'expr1 -o expr2'

True if either expr1 or expr2 is true.


expr: Evaluate expressions
Node: expr invocation, Next: , Prev: test invocation, Up: Conditions

expr: Evaluate expressions

expr evaluates an expression and writes the result on standard output.  Each token of the expression must be a separate argument.

Operands are either numbers or strings.  expr coerces anything appearing in an operand position to an integer or a string depending on the operation being applied to it.

Strings are not quoted for expr, though you may need to quote them to protect characters with special meaning to the shell, e.g., spaces.

Operators may given as infix symbols or prefix keywords.  Parentheses may be used for grouping in the usual manner (you must quote parentheses to avoid the shell evaluating them, however).

Exit status:

0 if the expression is neither null nor 0,
1 if the expression is null or 0,
2 for invalid expressions.

* Menu:

Relations for expr	| & < <= = == != >= >

Numeric expressions	+ - * / %

String expressions	: match substr index length

Examples of expr	Examples.


Relations for expr
Node: Relations for expr, Next: Numeric expressions, Prev: , Up: expr invocation

Relations for expr

The usual logical connectives and relations, in order of precedence.

'|'

Yields its first argument if it is neither null nor 0, otherwise its second argument.

'&'

Yields its first argument if neither argument is null or 0, otherwise 0.

'< <= = == != >= >'

Compare the arguments and return 1 if the relation is true, 0 otherwise.  == is a synonym for =.  expr first tries to coerce both arguments to numbers and do a numeric comparison; if either coercion fails, it does a lexicographic comparison.


Numeric expressions
Node: Numeric expressions, Next: String expressions, Prev: Relations for expr, Up: expr invocation

Numeric expressions

Numeric operators, in order of increasing precedence.  The connectives (previous section) have higher precedence, the string operators (following section) have lower.

'+ -'

Addition and subtraction.  Both arguments are coerced to numbers; an error occurs if this cannot be done.

'* / %'

Multiplication, division, remainder.  Both arguments are coerced to numbers; an error occurs if this cannot be done.


String expressions
Node: String expressions, Next: Examples of expr, Prev: Numeric expressions, Up: expr invocation

String expressions

String operators.  These have lowest precedence.

'string : regex'

Perform pattern matching.  The arguments are coerced to strings and the second is considered to be a (basic, a la grep) regular expression, with a ^ implicitly prepended.  The first argument is then matched against this regular expression.

If the match succeeds and regex uses '\(' and '\)', the : expression returns the part of string that matched the subexpression; otherwise, it returns the number of characters matched.

If the match fails, the : operator returns the null string if '\(' and '\)' are used in regex, otherwise 0.

Only the first '\( ... \)' pair is relevant to the return value; additional pairs are meaningful only for grouping the regular expression operators.

See Regular Expression Library, for details of regular expression syntax.

'match string regex'

An alternative way to do pattern matching.  This is the same as 'string : regex'.

'substr string position length'

Returns the substring of string beginning at position with length at most length.  If either position or length is negative or non-numeric, returns the null string.

'index string character-class'

Returns the first position in string where the first character in charset was found.  If no character in charset is found in string, return 0.

'length string'

Returns the length of string.

The keywords cannot be used as strings.


Examples of expr
Node: Examples of expr, Next: , Prev: String expressions, Up: expr invocation

Examples of expr

Here are a few examples, including quoting for shell metacharacters.

To add 1 to the shell variable foo, in Bourne-compatible shells:

foo=`expr $foo + 1`

To print the non-directory part of the file name stored in $fname, which need not contain a /.

expr $fname : '.*/\(^.*\)' '^|' $fname

expr abc : 'a\(.\)c'
=> b
expr index abcdef cz
=> 3
expr index index a
error--> expr: syntax error


Redirection
Node: Redirection, Next: File name manipulation, Prev: Conditions, Up: Top

Redirection

Unix shells commonly provide several forms of "redirection"--ways to change the input source or output destination of a command.  But one useful redirection is performed by a separate command, not by the shell; it's described here.

* Menu:

tee invocation	Redirect output to multiple files.


tee: Redirect output to multiple files
Node: tee invocation, Next: , Prev: , Up: Redirection

tee: Redirect output to multiple files

The tee command copies standard input to standard output and also to any files given as arguments.  This is useful when you want not only to send some data down a pipe, but also to save a copy.

Synopsis:

tee [ option ]... [ file ]...

If a file being written to does not already exist, it is created.  If a file being written to already exists, the data it previously contained is overwritten unless the -a option is used.

The program accepts the following options.  Also see See Common options.

'-a'

'--append'

Append standard input to the given files rather than overwriting them.

'-i'

'--ignore-interrupts'

Ignore interrupt signals.


File name manipulation
Node: File name manipulation, Next: Working context information, Prev: Redirection, Up: Top

File name manipulation

This section describes commands that manipulate file names.

* Menu:

basename invocation	Strip directory and suffix from a file name.

dirname invocation	Strip non-directory suffix from a file name.

pathchk invocation	Check file name portability.


basename: Strip directory and suffix from a file name
Node: basename invocation, Next: dirname invocation, Prev: , Up: File name manipulation

basename: Strip directory and suffix from a file name

Synopsis:

basename name [ suffix ]

The basename command removes any leading directory components from name.  If suffix is specified and is identical to the end of name, it is removed from name as well.  basename prints the result on standard output.

The only options are '--help' and '--version'.  See Common options.


dirname: Strip non-directory suffix from a file name
Node: dirname invocation, Next: pathchk invocation, Prev: basename invocation, Up: File name manipulation

dirname: Strip non-directory suffix from a file name

Synopsis:

dirname name

dirname prints all but the final slash-delimited component of name.  If name is a single component, dirname prints '.' (meaning the current directory).

The only options are '--help' and '--version'.  See Common options.


pathchk: Check file name portability
Node: pathchk invocation, Next: , Prev: dirname invocation, Up: File name manipulation

pathchk: Check file name portability

Synopsis:

pathchk [ option ]... name...

For each name, pathchk prints a message if any of these conditions is true:

1. 	one of the existing directories in name does not have search (execute) permission,

2. 	the length of name is larger than its filesystem's maximum file name length,

3. 	the length of one component of name, corresponding to an existing directory name, is larger than its filesystem's maximum length for a file name component.

The program accepts the following option.  Also see See Common options.

'-p'

'--portability'

Instead of performing length checks on the underlying filesystem, test the length of each file name and its components against the POSIX.1 minimum limits for portability.  Also check that the file name contains no characters not in the portable file name character set.

Exit status:

0 if all specified file names passed all of the tests,
1 otherwise.


Working context information
Node: Working context information, Next: User information, Prev: File name manipulation, Up: Top

Working context information

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.

* Menu:

pwd invocation	Print working directory.

stty invocation	Print or change terminal characteristics.

printenv invocation	Print environment variables.

tty invocation	Print file name of terminal on standard input.


pwd: Print working directory
Node: pwd invocation, Next: stty invocation, Prev: , Up: Working context information

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 Common options.


stty: Print or change terminal characteristics
Node: stty invocation, Next: printenv invocation, Prev: pwd invocation, Up: Working context information

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 See Common options.

'-a'

'--all'

Print all current settings in human-readable form.

'-g'

'--save'

Print all current settings in a form that can be used as an argument to another 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.

* Menu:

Control	Control settings

Input	Input settings

Output	Output settings

Local	Local settings

Combination	Combination settings

Characters	Special characters

Special	Special settings


Control settings
Node: Control, Next: Input, Prev: , Up: stty invocation

Control settings

Control settings:

'parenb'

Generate parity bit in output and expect parity bit in input.  May be negated.

'parodd'

Set odd parity (even if negated).  May be negated.

'cs5'

'cs6'

'cs7'

'cs8'

Set character size to 5, 6, 7, or 8 bits.

'hup'

'hupcl'

Send a hangup signal when the last process closes the tty.  May be negated.

'cstopb'

Use two stop bits per character (one if negated).  May be negated.

'cread'

Allow input to be received.  May be negated.

'clocal'

Disable modem control signals.  May be negated.

'crtscts'

Enable RTS/CTS flow control.  Non-POSIX.  May be negated.


Input settings
Node: Input, Next: Output, Prev: Control, Up: stty invocation

Input settings

'ignbrk'

Ignore breaks.  May be negated.

'brkint'

Make breaks cause an interrupt signal.  May be negated.

'ignpar'

Ignore parity errors.  May be negated.

'parmrk'

Mark parity errors (with a 255-0-character sequence).  May be negated.

'inpck'

Enable input parity checking.  May be negated.

'istrip'

Clear high (8th) bit of input characters.  May be negated.

'inlcr'

Translate newline to carriage return.  May be negated.

'igncr'

Ignore carriage return.  May be negated.

'icrnl'

Translate carriage return to newline.  May be negated.

'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.  May be negated.

'iuclc'

Translate uppercase characters to lowercase.  Non-POSIX.  May be negated.

'ixany'

Allow any character to restart output (only the start character if negated).  Non-POSIX.  May be negated.

'imaxbel'

Enable beeping and not flushing input buffer if a character arrives when the input buffer is full.  Non-POSIX.  May be negated.


Output settings
Node: Output, Next: Local, Prev: Input, Up: stty invocation

Output settings

These arguments specify output-related operations.

'opost'

Postprocess output.  May be negated.

'olcuc'

Translate lowercase characters to uppercase.  Non-POSIX.  May be negated.

'ocrnl'

Translate carriage return to newline.  Non-POSIX.  May be negated.

'onlcr'

Translate newline to carriage return-newline.  Non-POSIX.  May be negated.

'onocr'

Do not print carriage returns in the first column.  Non-POSIX.  May be negated.

'onlret'

Newline performs a carriage return.  Non-POSIX.  May be negated.

'ofill'

Use fill (padding) characters instead of timing for delays.  Non-POSIX.  May be negated.

'ofdel'

Use delete characters for fill instead of null characters.  Non-POSIX.  May be negated.

'nl1'

'nl0'

Newline delay style.  Non-POSIX.

'cr3'

'cr2'

'cr1'

'cr0'

Carriage return delay style.  Non-POSIX.

'tab3'

'tab2'

'tab1'

'tab0'

Horizontal tab delay style.  Non-POSIX.

'bs1'

'bs0'

Backspace delay style.  Non-POSIX.

'vt1'

'vt0'

Vertical tab delay style.  Non-POSIX.

'ff1'

'ff0'

Form feed delay style.  Non-POSIX.


Local settings
Node: Local, Next: Combination, Prev: Output, Up: stty invocation

Local settings

'isig'

Enable interrupt, quit, and suspend special characters.  May be negated.

'icanon'

Enable erase, kill, werase, and rprnt special characters.  May be negated.

'iexten'

Enable non-POSIX special characters.  May be negated.

'echo'

Echo input characters.  May be negated.

'echoe'

'crterase'

Echo erase characters as backspace-space-backspace.  May be negated.

'echok'

Echo a newline after a kill character.  May be negated.

'echonl'

Echo newline even if not echoing other characters.  May be negated.

'noflsh'

Disable flushing after interrupt and quit special characters.  May be negated.

'xcase'

Enable input and output of uppercase characters by preceding their lowercase equivalents with '\', when icanon is set.  Non-POSIX.  May be negated.

'tostop'

Stop background jobs that try to write to the terminal.  Non-POSIX.  May be negated.

'echoprt'

'prterase'

Echo erased characters backward, between '\' and '/'.  Non-POSIX.  May be negated.

'echoctl'

'ctlecho'

Echo control characters in hat notation ('^c') instead of literally.  Non-POSIX.  May be negated.

'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.  Non-POSIX.  May be negated.


Combination settings
Node: Combination, Next: Characters, Prev: Local, Up: stty invocation

Combination settings

Combination settings:

'evenp'

'parity'

Same as parenb -parodd cs7.  May be negated.  If negated, same as -parenb cs8.

'oddp'

Same as parenb parodd cs7.  May be negated.  If negated, same as -parenb cs8.

'nl'

Same as -icrnl -onlcr.  May be negated.  If negated, same as icrnl -inlcr -igncr onlcr -ocrnl -onlret.

'ek'

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

'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

 and also sets all special characters to their default values.

'cooked'

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.

'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.

'cbreak'

Same as -icanon.  May be negated.  If negated, same as icanon.

'pass8'

Same as -parenb -istrip cs8.  May be negated.  If negated, same as parenb istrip cs7.

'litout'

Same as -parenb -istrip -opost cs8.  May be negated.  If negated, same as parenb istrip opost cs7.

'decctlq'

Same as -ixany.  Non-POSIX.  May be negated.

'tabs'

Same as tab0.  Non-POSIX.  May be negated.  If negated, same as tab3.

'lcase'

'LCASE'

Same as xcase iuclc olcuc.  Non-POSIX.  May be negated.

'crt'

Same as echoe echoctl echoke.

'dec'

Same as echoe echoctl echoke -ixany intr ^C erase ^? kill C-u.


Special characters
Node: Characters, Next: Special, Prev: Combination, Up: stty invocation

Special characters

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.)

'intr'

Send an interrupt signal.

'quit'

Send a quit signal.

'erase'

Erase the last character typed.

'kill'

Erase the current line.

'eof'

Send an end of file (terminate the input).

'eol'

End the line.

'eol2'

Alternate character to end the line.  Non-POSIX.

'swtch'

Switch to a different shell layer.  Non-POSIX.

'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.  Non-POSIX.

'rprnt'

Redraw the current line.  Non-POSIX.

'werase'

Erase the last word typed.  Non-POSIX.

'lnext'

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


Special settings
Node: Special, Next: , Prev: Characters, Up: stty invocation

Special settings

'min n'

Set the minimum number of characters that will satisfy a read until the time value has expired, when -icanon is set.

'time n'

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

'ispeed n'

Set the input speed to n.

'ospeed n'

Set the output speed to n.

'rows n'

Tell the tty kernel driver that the terminal has n rows.  Non-POSIX.

'cols n'

'columns n'

Tell the kernel that the terminal has n columns.  Non-POSIX.

'size'

Print the number of rows and columns that the kernel thinks the terminal has.  (Systems that don't support rows and cols in the kernel typically use the environment variables LINES and COLUMNS instead; however, GNU stty does not know anything about them.) Non-POSIX.

'line n'

Use line discipline n.  Non-POSIX.

'speed'

Print the terminal speed.

'n'

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.  0 hangs up the line if -clocal is set.


printenv: Print all or some environment variables
Node: printenv invocation, Next: tty invocation, Prev: stty invocation, Up: Working context information

printenv: Print all or some environment variables

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 only options are a lone '--help' or '--version'.  See Common options.

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


tty: Print file name of terminal on standard input
Node: tty invocation, Next: , Prev: printenv invocation, Up: Working context information

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 See Common options.

'-s'

'--silent'

'--quiet'

Print nothing; only return an exit status.

Exit status:

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


User information
Node: User information, Next: System context, Prev: Working context information, Up: Top

User information

This section describes commands that print user-related information: logins, groups, and so forth.

* Menu:

id invocation	Print real and effective uid and gid.

logname invocation	Print current login name.

whoami invocation	Print effective user id.

groups invocation	Print group names a user is in.

users invocation	Print login names of users currently logged in.

who invocation	Print who is currently logged in.


id: Print real and effective uid and gid
Node: id invocation, Next: logname invocation, Prev: , Up: User information

id: Print real and effective uid and gid

 id prints information about the given user, or the process running it if no user is specified.

Synopsis:

id [ option ]... [ username ]

By default, it prints the real user id, real group id, effective user id if different from the real user id, effective group id if different from the real group id, and supplemental group ids.

Each of these numeric values is preceded by an identifying string and followed by the corresponding user or group name in parentheses.

The options cause id to print only part of the above information.  Also see See Common options.

'-g'

'--group'

Print only the group id.

'-G'

'--groups'

Print only the supplementary groups.

'-n'

'--name'

Print the user or group name instead of the ID number.  Requires -u, -g, or -G.

'-r'

'--real'

Print the real, instead of effective, user or group id.  Requires -u, -g, or -G.

'-u'

'--user'

Print only the user id.


logname: Print current login name
Node: logname invocation, Next: whoami invocation, Prev: id invocation, Up: User information

logname: Print current login name

logname prints the calling user's name, as found in the file '/etc/utmp', and exits with a status of 0.  If there is no '/etc/utmp' entry for the calling process, logname prints an error message and exits with a status of 1.

The only options are '--help' and '--version'.  See Common options.


whoami: Print effective user id
Node: whoami invocation, Next: groups invocation, Prev: logname invocation, Up: User information

whoami: Print effective user id

whoami prints the user name associated with the current effective user id.  It is equivalent to the command 'id -un'.

The only options are '--help' and '--version'.  See Common options.


groups: Print group names a user is in
Node: groups invocation, Next: users invocation, Prev: whoami invocation, Up: User information

groups: Print group names a user is in

groups prints the names of the primary and any supplementary groups that each given username, or the current process if none are given, is in.  If user names are given, the name of each user is printed before the list of that user's groups.

Synopsis:

groups [ username ]...

The group lists are equivalent to the output of the command 'id -Gn'.

The only options are '--help' and '--version'.  See Common options.


users: Print login names of users currently logged in
Node: users invocation, Next: who invocation, Prev: groups invocation, Up: User information

users: Print login names of users currently logged in

users prints on a single line a blank-separated list of user names of users currently logged in to the current host.  Each user name corresponds to a login session, so if a user has more than one login session, that user's name will appear the same number of times in the output.

Synopsis:

users [ file ]

With no file argument, users extracts its information from the file '/etc/utmp'.  If a file argument is given, users uses that file instead.  A common choice is '/etc/wtmp'.

The only options are '--help' and '--version'.  See Common options.


who: Print who is currently logged in
Node: who invocation, Next: , Prev: users invocation, Up: User information

who: Print who is currently logged in

Synopsis:

who [ option ] [ file ] [ am i ]

If given no non-option arguments, who prints the following information for each user currently logged on: login name, terminal line, login time, and remote hostname or X display.

If given one non-option argument, who uses that instead of '/etc/utmp' as the name of the file containing the record of users logged on.  '/etc/wtmp' is commonly given as an argument to who to look at who has previously logged on.

If given two non-option arguments, who prints only the entry for the user running it (determined from its standard input), preceded by the hostname.  Traditionally, the two arguments given are 'am i', as in 'who am i'.

The program accepts the following options.  Also see See Common options.

'-m'

Same as 'who am i'.

'-q'

'--count'

Print only the login names and the number of users logged on.  Overrides all other options.

'-s'

Ignored; for compatibility with other versions of who.

'-i'

'-u'

'--idle'

After the login time, print the number of hours and minutes that the user has been idle.  '.' means the user was active in last minute.  'old' means the user was idle for more than 24 hours.

'-H'

'--heading'

Print a line of column headings.

'-w'

'-T'

'--mesg'

'--message'

'--writable'

After each login name print a character indicating the user's message status:

'+' allowing write messages
'-' disallowing write messages
'?' cannot find terminal device


System context
Node: System context, Next: Modified command invocation, Prev: User information, Up: Top

System context

This section describes commands that print or change system-wide information.

* Menu:

date invocation	Print or set system date and time.

uname invocation	Print system information.

hostname invocation	Print or set system name.


date: Print or set system date and time
Node: date invocation, Next: uname invocation, Prev: , Up: System context

date: Print or set system date and time

date with no arguments prints the current time and date, in the format of the '%c' directive (described below).

Synopses:

date [ option ]... [ +format ]
date [ -u|--utc|--universal ] [ MMDDhhmm[[CC]YY][.ss] ]

If given an argument that starts with a '+', date prints the current time and date (or the time and date specified by the --date option, see below) in the format defined by that argument, which is the same as in the strftime function.  Except for directives, which start with '%', characters in the format string are printed unchanged.  The directives are described below.

By default, date pads numeric fields with zeroes.  GNU date recognizes the following numeric modifiers between the '%' and the directive.  These are GNU extensions.

'-'

(hyphen) do not pad the field

'_'

(underscore) pad the field with spaces

* Menu:

Time directives	%[HIklMprsSTXZ]

Date directives	%[aAbBcdDhjmUwWxyY]

Literal directives	%[%nt]

Setting the time	Changing the system clock.

Options for date	Instead of the current time.

Examples of date	Examples.


Time directives
Node: Time directives, Next: Date directives, Prev: , Up: date invocation

Time directives

date directives related to times.

'%H'

hour (00...23)

'%I'

hour (01...12)

'%k'

hour ( 0...23)

'%l'

hour ( 1...12)

'%M'

minute (00...59)

'%p'

locale's AM or PM

'%r'

time, 12-hour (hh:mm:ss [AP]M)

'%s'

seconds since the epoch, i.e., 1 January 1970 00:00:00 UTC (a GNU extension)

'%S'

second (00...61)

'%T'

time, 24-hour (hh:mm:ss)

'%X'

locale's time representation (%H:%M:%S)

'%Z'

time zone (e.g., EDT), or nothing if no time zone is determinable


Date directives
Node: Date directives, Next: Literal directives, Prev: Time directives, Up: date invocation

Date directives

date directives related to dates.

'%a'

locale's abbreviated weekday name (Sun...Sat)

'%A'

locale's full weekday name, variable length (Sunday...Saturday)

'%b'

locale's abbreviated month name (Jan...Dec)

'%B'

locale's full month name, variable length (January...December)

'%c'

locale's date and time (Sat Nov 04 12:02:33 EST 1989)

'%d'

day of month (01...31)

'%D'

date (mm/dd/yy)

'%h'

same as %b

'%j'

day of year (001...366)

'%m'

month (01...12)

'%U'

week number of year with Sunday as first day of week (00...53)

'%w'

day of week (0...6) with 0 corresponding to Sunday

'%W'

week number of year with Monday as first day of week (00...53)

'%x'

locale's date representation (mm/dd/yy)

'%y'

last two digits of year (00...99)

'%Y'

year (1970....)


Literal directives
Node: Literal directives, Next: Setting the time, Prev: Date directives, Up: date invocation

Literal directives

date directives that produce literal strings.

'%%'

a literal %

'%n'

a newline

'%t'

a horizontal tab


Setting the time
Node: Setting the time, Next: Options for date, Prev: Literal directives, Up: date invocation

Setting the time

If given an argument that does not start with '+', date sets the system clock to the time and date specified by that argument (as described below).  You must have appropriate privileges to set the system clock.  The '--date' and '--set' options may not be used with such an argument.  The '--universal' option may be used with such an argument to indicate that the specified time and date are relative to Coordinated Universal Time rather than to the local time zone.

The argument must consist entirely of digits, which have the following meaning:

MM

month

DD

day within month

hh

hour

mm

minute

CC

first two digits of year (optional)

YY

last two digits of year (optional)

ss

second (optional)

The '--set' option also sets the system clock; see the next section.


Options for date
Node: Options for date, Next: Examples of date, Prev: Setting the time, Up: date invocation

Options for date

The program accepts the following options.  Also see See Common options.

'-d datestr'

'--date=datestr'

Display the time and date specified in datestr instead of the current time and date.  datestr can be in almost any common format.  It can contain month names, timezones, 'am' and 'pm', 'yesterday', 'ago', 'next', etc.  The source file 'getdate.y' implements this parsing for all GNU routines; we need precise documentation!

'-f datefile'

'--file=datefile'

Parse each line in datefile as with '-d' and display the resulting time and date.  If datefile is '-', use standard input.  This is useful when you have many dates to process, because the system overhead of starting up the date executable many times can be considerable.

'-s datestr'

'--set=datestr'

Set the time and date to datestr,  See '-d' above.

'-u'

'--utc'

'--universal'

Print or set the time and date in Universal Coordinated Time instead of in local (wall clock) time.


Examples of date
Node: Examples of date, Next: , Prev: Options for date, Up: date invocation

Examples of date

Here are a few examples.  Also see the documentation for the '-d' option in the previous section.

•	To print the date of the day before yesterday:

date --date='2 days ago'

•	To print the date of the day three months and one day hence:

date --date='3 months 1 day'

•	To print the day of year of Christmas in the current year:

date --date='25 Dec' +%j

•	To print the current full month name and the day of the month:

date '+%B %d'

But this may not be what you want because for the first nine days of the month, the '%d' expands to a zero-padded two-digit field, for example 'date -d 1may '+%B %d'' will print 'May 01'.

•	To print a date without the leading zero for one-digit days of the month, you can use the (GNU extension) - modifier to suppress the padding altogether.

date -d=1may '+%B %-d'

•	To print the current date and time in the format required by many non-GNU versions of date when setting the system clock:

date +%m%d%H%M%Y.%S

•	To set the system clock forward by two minutes:

date --set='+2 minutes'


uname: Print system information
Node: uname invocation, Next: hostname invocation, Prev: date invocation, Up: System context

uname: Print system information

uname prints information about the machine and operating system it is run on.  If no options are given, uname acts as if the -s option were given.

Synopsis:

uname [ option ]...

If multiple options or -a are given, the selected information is printed in this order:

sysname nodename release osversion machine

The osversion, at least, may well be multiple words.  For example:

bash$ uname -a
=> Linux hayley 1.0.4 #3 Thu May 12 18:06:34 1994 i486

The program accepts the following options.  Also see See Common options.

'-a'

'--all'

Print all of the below information.

'-m'

'--machine'

Print the machine (hardware) type.

'-n'

'--nodename'

Print the machine's network node hostname.

'-r'

'--release'

Print the operating system release.

'-s'

'--sysname'

Print the operating system name.

'-v'

Print the operating system version.


hostname: Print or set system name
Node: hostname invocation, Next: , Prev: uname invocation, Up: System context

hostname: Print or set system name

With no arguments, hostname prints the name of the current host system.  With one argument, it sets the current host name to the specified string.  You must have appropriate privileges to set the host name.

Synopsis:

hostname [ name ]

The only options are '--help' and '--version'.  See Common options.


Modified command invocation
Node: Modified command invocation, Next: Delaying, Prev: System context, Up: Top

Modified command invocation

This section describes commands that run other commands in some context different than the current one: a modified environment, as a different user, etc.

* Menu:

env invocation	Modify environment variables.

nice invocation	Modify scheduling priority.

nohup invocation	Immunize to hangups.

su invocation	Modify user and group id.


env: Run a command in a modified environment
Node: env invocation, Next: nice invocation, Prev: , Up: Modified command invocation

env: Run a command in a modified environment

env runs a command with an environment modified as specified by the command line arguments.

Synopses:

env [ option ]... [ name=value ]... [ command [ args ]... ]
env

Arguments of the form 'variable=value' set the environment variable variable to value value.  value may be empty ('variable=').  Setting a variable to an empty value is different from unsetting it.

The first remaining argument specifies the program name to invoke; it is searched for according to the PATH environment variable.  Any remaining arguments are passed as arguments to that program.

If no command name is specified following the environment specifications, the resulting environment is printed.  This is like specifying a command name of printenv.

The program accepts the following options.  Also see See Common options.

'-u name'

'--unset=name'

Remove variable name from the environment, if it was in the environment.

'-'

'-i'

'--ignore-environment'

Start with an empty environment, ignoring the inherited environment.


nice: Run a command with modified scheduling priority
Node: nice invocation, Next: nohup invocation, Prev: env invocation, Up: Modified command invocation

nice: Run a command with modified scheduling priority

If no arguments are given, nice prints the current scheduling priority, which it inherited.  Otherwise, nice runs the given command with its scheduling priority adjusted.  If no adjustment is given, the priority of the command is incremented by 10.  You must have appropriate privileges to specify a negative adjustment.  The priority can be adjusted by nice over the range of -20 (the highest priority) to 19 (the lowest).

Synopsis:

nice [ option ]... [ command [ arg ]... ]

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 program accepts the following option.  Also see See Common options.

'-n adjustment'

'-adjustment'

'--adjustment=adjustment'

Add adjustment instead of 10 to the command's priority.


nohup: Run a command immune to hangups
Node: nohup invocation, Next: su invocation, Prev: nice invocation, Up: Modified command invocation

nohup: Run a command immune to hangups

nohup runs the given command with hangup signals ignored, so that the command can continue running in the background after you log out.

Synopsis:

nohup command [ arg ]...

Also, the scheduling priority is increased by 5.  If standard output is a tty, it and standard error are redirected so that they are appended to the file 'nohup.out'; if that cannot be written to, they are appended to the file '$HOME/nohup.out'.  If that cannot be written to, the command is not run.

If nohup creates either 'nohup.out' or '$HOME/nohup.out', it creates it with no "group" or "other" access permissions.  It does not change the permissions if the output file already existed.

nohup does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an '&'.

The only options are '--help' and '--version'.  See Common options.


su: Run a command with substitute user and group id
Node: su invocation, Next: , Prev: nohup invocation, Up: Modified command invocation

su: Run a command with substitute user and group id

su allows one user to temporarily become another user.  It runs a command (often an interactive shell) with the real and effective user id, group id, and supplemental groups of a given user.

Synopsis:

su [ option ]... [ user [ arg ]... ]

If no user is given, the default is root, the super-user.  The shell to use is taken from user's passwd entry, or '/bin/sh' if none is specified there.  If user has a password, su prompts for the password unless run by a user with effective user id of zero (the super-user).

By default, su does not change the current directory.  It sets the environment variables HOME and SHELL from the password entry for user, and if user is not the super-user, sets USER and LOGNAME to user.  By default, the shell is not a login shell.

Any additional args are passed as additional arguments to the shell.

GNU su does not treat '/bin/sh' or any other shells specially (e.g., by setting argv[0] to '-su', passing -c only to certain shells, etc.).

su can optionally be compiled to use syslog to report failed, and optionally successful, su attempts.  (If the system supports syslog.)  However, GNU su does not check if the user is a member of the wheel group; see below.

The program accepts the following options.  Also see See Common options.

'-c command'

'--command=command'

Pass command, a single command line to run, to the shell with a -c option instead of starting an interactive shell.

'-f'

'--fast'

Pass the -f option to the shell.  This probably only makes sense if the shell run is csh or tcsh, for which the -f option prevents reading the startup file ('.cshrc').  With Bourne-like shells, the -f option disables file name pattern expansion (globbing), which is not likely to be useful.

'-'

'-l'

'--login'

Make the shell a login shell.  This means the following.  Unset all environment variables except TERM, HOME, and SHELL (which are set as described above), and USER and LOGNAME (which are set, even for the super-user, as described above), and set PATH to a compiled-in default value.  Change to user's home directory.  Prepend '-' to the shell's name, intended to make it read its login startup file(s).

'-m'

'-p'

'--preserve-environment'

Do not change the environment variables HOME, USER, LOGNAME, or SHELL.  Run the shell given in the environment variable SHELL instead of the shell from user's passwd entry, unless the user running su is not the superuser and user's shell is restricted.  A "restricted shell" is one that is not listed in the file '/etc/shells', or in a compiled-in list if that file does not exist.  Parts of what this option does can be overridden by --login and --shell.

'-s shell'

'--shell=shell'

Run shell instead of the shell from user's passwd entry, unless the user running su is not the superuser and user's shell is restricted (see '-m' just above).

Why GNU su does not support the 'wheel' group

(This section is by Richard Stallman.)

Sometimes a few of the users try to hold total power over all the rest.  For example, in 1984, a few users at the MIT AI lab decided to seize power by changing the operator password on the Twenex system and keeping it secret from everyone else.  (I was able to thwart this coup and give power back to the users by patching the kernel, but I wouldn't know how to do that in Unix.)

However, occasionally the rulers do tell someone.  Under the usual su mechanism, once someone learns the root password who sympathizes with the ordinary users, he or she can tell the rest.  The "wheel group" feature would make this impossible, and thus cement the power of the rulers.

I'm on the side of the masses, not that of the rulers.  If you are used to supporting the bosses and sysadmins in whatever they do, you might find this idea strange at first.


Delaying
Node: Delaying, Next: Index, Prev: Modified command invocation, Up: Top

Delaying

Perhaps wait or other commands should be described here also?

* Menu:

sleep invocation	Delay for a specified time.


sleep: Delay for a specified time
Node: sleep invocation, Next: , Prev: , Up: Delaying

sleep: Delay for a specified time

sleep pauses for an amount of time specified by the sum of the values of the command line arguments.

Synopsis:

sleep [ number[smhd] ]...

Each argument is a number followed by an optional unit; the default is seconds.  The units are:

's'

seconds

'm'

minutes

'h'

hours

'd'

days

The only options are '--help' and '--version'.  See Common options.


Index
Node: Index, Next: , Prev: Delaying, Up: Top

Index

!:	See Connectives for test.

!=:	See String tests.

%:	See Numeric expressions.

&:	See Relations for expr.

*:	See Numeric expressions.

+:	See Numeric expressions.

- <1>:	See su invocation.

- <1>:	See env invocation.

-:	See Numeric expressions.

-adjustment:	See nice invocation.

-all <1>:	See stty invocation.

-all:	See uname invocation.

-append:	See tee invocation.

-command:	See su invocation.

-count:	See who invocation.

-date:	See Options for date.

-fast:	See su invocation.

-file:	See Options for date.

-group:	See id invocation.

-groups:	See id invocation.

-heading:	See who invocation.

-help:	See Common options.

-idle:	See who invocation.

-ignore-environment:	See env invocation.

-ignore-interrupts:	See tee invocation.

-login:	See su invocation.

-machine:	See uname invocation.

-mesg:	See who invocation.

-message:	See who invocation.

-name:	See id invocation.

-nodename:	See uname invocation.

-portability:	See pathchk invocation.

-preserve-environment:	See su invocation.

-quiet:	See tty invocation.

-real:	See id invocation.

-release:	See uname invocation.

-save:	See stty invocation.

-set:	See Options for date.

-shell:	See su invocation.

-silent:	See tty invocation.

-sysname:	See uname invocation.

-universal:	See Options for date.

-user:	See id invocation.

-utc:	See Options for date.

-version:	See Common options.

-writable:	See who invocation.

-adjustment:	See nice invocation.

-a <1>:	See tee invocation.

-a <1>:	See stty invocation.

-a <1>:	See Connectives for test.

-a:	See uname invocation.

-b:	See File type tests.

-c <1>:	See su invocation.

-c:	See File type tests.

-d <1>:	See Options for date.

-d:	See File type tests.

-e <1>:	See echo invocation.

-e:	See File characteristics tests.

-ef:	See File characteristics tests.

-eq:	See Numeric tests.

-f <1>:	See File type tests.

-f <1>:	See su invocation.

-f:	See Options for date.

-g:	See stty invocation.

-G:	See id invocation.

-g <1>:	See Access permission tests.

-g:	See id invocation.

-ge:	See Numeric tests.

-gt:	See Numeric tests.

-H:	See who invocation.

-h:	See File type tests.

-i <1>:	See env invocation.

-i <1>:	See tee invocation.

-i:	See who invocation.

-k:	See Access permission tests.

-L:	See File type tests.

-l:	See su invocation.

-le:	See Numeric tests.

-lt:	See Numeric tests.

-m <1>:	See su invocation.

-m <1>:	See who invocation.

-m:	See uname invocation.

-n <1>:	See echo invocation.

-n <1>:	See id invocation.

-n <1>:	See nice invocation.

-n <1>:	See String tests.

-n:	See uname invocation.

-ne:	See Numeric tests.

-nt:	See File characteristics tests.

-o:	See Connectives for test.

-O:	See Access permission tests.

-ot:	See File characteristics tests.

-p <1>:	See File type tests.

-p <1>:	See su invocation.

-p:	See pathchk invocation.

-q:	See who invocation.

-r <1>:	See id invocation.

-r <1>:	See Access permission tests.

-r:	See uname invocation.

-S:	See File type tests.

-s <1>:	See File characteristics tests.

-s <1>:	See who invocation.

-s <1>:	See tty invocation.

-s <1>:	See Options for date.

-s <1>:	See uname invocation.

-s:	See su invocation.

-T:	See who invocation.

-t:	See File type tests.

-u <1>:	See Access permission tests.

-u <1>:	See Options for date.

-u <1>:	See env invocation.

-u <1>:	See who invocation.

-u:	See id invocation.

-unset:	See env invocation.

-v:	See uname invocation.

-w <1>:	See Access permission tests.

-w:	See who invocation.

-x:	See Access permission tests.

-z:	See String tests.

.cshrc:	See su invocation.

/:	See Numeric expressions.

/bin/sh:	See su invocation.

/etc/passwd:	See su invocation.

/etc/shells:	See su invocation.

/etc/utmp <1>:	See logname invocation.

/etc/utmp <1>:	See who invocation.

/etc/utmp:	See users invocation.

/etc/wtmp <1>:	See who invocation.

/etc/wtmp:	See users invocation.

<:	See Relations for expr.

<=:	See Relations for expr.

= <1>:	See String tests.

=:	See Relations for expr.

==:	See Relations for expr.

>:	See Relations for expr.

>=:	See Relations for expr.

date options:	See Options for date.

-su:	See su invocation.

\0ooo:	See printf invocation.

\0xhhh:	See printf invocation.

\c:	See printf invocation.

access permission tests:	See Access permission tests.

addition:	See Numeric expressions.

am i:	See who invocation.

and operator <1>:	See Relations for expr.

and operator:	See Connectives for test.

appropriate privileges <1>:	See Setting the time.

appropriate privileges <1>:	See nice invocation.

appropriate privileges:	See hostname invocation.

arbitrary date strings, parsing:	See Options for date.

arbitrary text, displaying:	See echo invocation.

arithmetic tests:	See Numeric tests.

background jobs, stopping at terminal write:	See Local.

backslash escapes:	See echo invocation.

basename:	See basename invocation.

baud rate, setting:	See Special.

beeping at input buffer full:	See Input.

beginning of time:	See Time directives.

block special check:	See File type tests.

breaks, cause interrupts:	See Input.

breaks, ignoring:	See Input.

brkint:	See Input.

bsn:	See Output.

bugs, reporting:	See Introduction.

built-in shell commands, conflicts with <1>:	See pwd invocation.

built-in shell commands, conflicts with <1>:	See test invocation.

built-in shell commands, conflicts with:	See nice invocation.

C-s/C-q flow control:	See Input.

case translation:	See Local.

cbreak:	See Combination.

change or print terminal settings:	See stty invocation.

character size:	See Control.

character special check:	See File type tests.

characters, special:	See Characters.

check file types:	See test invocation.

clocal:	See Control.

cols:	See Special.

columns:	See Special.

combination settings:	See Combination.

commands for delaying:	See Delaying.

commands for exit status:	See Conditions.

commands for file name manipulation:	See File name manipulation.

commands for invoking other commands:	See Modified command invocation.

commands for printing text:	See Printing text.

commands for printing the working context:	See Working context information.

commands for printing user information:	See User information.

commands for redirection:	See Redirection.

commands for system context:	See System context.

common options:	See Common options.

compare values:	See test invocation.

comparison operators:	See Relations for expr.

conditions:	See Conditions.

conflicts with shell built-ins <1>:	See pwd invocation.

conflicts with shell built-ins <1>:	See test invocation.

conflicts with shell built-ins:	See nice invocation.

connectives, logical <1>:	See Connectives for test.

connectives, logical:	See Relations for expr.

context, system:	See System context.

control characters, using ^c:	See Local.

control settings:	See Control.

cooked:	See Combination.

coordinated universal time:	See Options for date.

crn:	See Output.

cread:	See Control.

crt:	See Combination.

crterase:	See Local.

crtkill:	See Local.

crtscts:	See Control.

csn:	See Control.

cstopb:	See Control.

ctlecho:	See Local.

current working directory, printing:	See pwd invocation.

date:	See date invocation.

date directives:	See Date directives.

date strings, parsing:	See Options for date.

dec:	See Combination.

decctlq:	See Combination.

delay for a specified time:	See sleep invocation.

delaying commands:	See Delaying.

destinations, multiple output:	See tee invocation.

directives, date:	See Date directives.

directives, literal:	See Literal directives.

directives, time:	See Time directives.

directory check:	See File type tests.

directory components, printing:	See dirname invocation.

directory, stripping from file names:	See basename invocation.

dirname:	See dirname invocation.

disabling special characters:	See Characters.

displaying text:	See echo invocation.

division:	See Numeric expressions.

do nothing, successfully:	See true invocation.

dsusp:	See Characters.

echo <1>:	See echo invocation.

echo:	See Local.

echoctl:	See Local.

echoe:	See Local.

echok:	See Local.

echoke:	See Local.

echonl:	See Local.

echoprt:	See Local.

effective uid and gid, printing:	See id invocation.

effective UID, printing:	See whoami invocation.

eight-bit characters <1>:	See Control.

eight-bit characters:	See Combination.

eight-bit input:	See Input.

ek:	See Combination.

env:	See env invocation.

environment variables, printing:	See printenv invocation.

environment, preserving:	See su invocation.

environment, printing:	See env invocation.

environment, running a program in a modified:	See env invocation.

eof:	See Characters.

eol:	See Characters.

eol2:	See Characters.

epoch, seconds since:	See Time directives.

equal string check:	See String tests.

erase:	See Characters.

evaluation of expressions:	See expr invocation.

even parity:	See Control.

evenp:	See Combination.

examples of date:	See Examples of date.

examples of expr:	See Examples of expr.

executable file check:	See Access permission tests.

existence-of-file check:	See File characteristics tests.

exit status commands:	See Conditions.

exit status of expr:	See expr invocation.

exit status of pathchk:	See pathchk invocation.

exit status of printenv:	See printenv invocation.

exit status of true <1>:	See true invocation.

exit status of true:	See false invocation.

exit status of tty:	See tty invocation.

expr:	See expr invocation.

expression evaluation <1>:	See test invocation.

expression evaluation:	See expr invocation.

expressions, numeric:	See Numeric expressions.

expressions, string:	See String expressions.

failure exit status:	See false invocation.

false:	See false invocation.

fascism:	See su invocation.

ffn:	See Output.

fields, padding numeric:	See date invocation.

file characteristics tests:	See File characteristics tests.

file name manipulation:	See File name manipulation.

file name pattern expansion, disabled:	See su invocation.

file names, checking validity and portability:	See pathchk invocation.

file names, stripping directory and suffix:	See basename invocation.

file type tests:	See File type tests.

flow control, hardware:	See Control.

flow control, software:	See Input.

flushing, disabling:	See Local.

formatting times:	See date invocation.

getdate.y:	See Options for date.

globbing, disabled:	See su invocation.

Greenwich Mean Time:	See Options for date.

group wheel, not supported:	See su invocation.

groups:	See groups invocation.

hangups, immunity to:	See nohup invocation.

hard link check:	See File characteristics tests.

hardware flow control:	See Control.

hardware type:	See uname invocation.

hat notation for control characters:	See Local.

help, online:	See Common options.

history:	See Introduction.

HOME:	See su invocation.

hostname <1>:	See hostname invocation.

hostname:	See uname invocation.

hup[cl]:	See Control.

icanon:	See Local.

icrnl:	See Input.

id:	See id invocation.

idle time:	See who invocation.

iexten:	See Local.

ignbrk:	See Input.

igncr:	See Input.

ignpar:	See Input.

imaxbel:	See Input.

immunity to hangups:	See nohup invocation.

index:	See String expressions.

information, about current users:	See who invocation.

inlcr:	See Input.

inpck:	See Input.

input settings:	See Input.

intr:	See Characters.

introduction:	See Introduction.

invocation of commands, modified:	See Modified command invocation.

isig:	See Local.

ispeed:	See Special.

istrip:	See Input.

iuclc:	See Input.

ixany:	See Input.

ixoff:	See Input.

ixon:	See Input.

kill:	See Characters.

last day:	See Options for date.

LCASE:	See Combination.

leading directory components, stripping:	See basename invocation.

length:	See String expressions.

line:	See Special.

line settings of terminal:	See stty invocation.

LINES:	See Special.

literal directives:	See Literal directives.

litout:	See Combination.

lnext:	See Characters.

local settings:	See Local.

logical and operator <1>:	See Relations for expr.

logical and operator:	See Connectives for test.

logical connectives <1>:	See Connectives for test.

logical connectives:	See Relations for expr.

logical or operator <1>:	See Relations for expr.

logical or operator:	See Connectives for test.

login name, printing:	See logname invocation.

login sessions, printing users with:	See users invocation.

login shell:	See su invocation.

login shell, creating:	See su invocation.

login time:	See who invocation.

LOGNAME:	See su invocation.

logname:	See logname invocation.

lowercase, translating to output:	See Output.

machine type:	See uname invocation.

machine-readable stty output:	See stty invocation.

manipulation of file names:	See File name manipulation.

match:	See String expressions.

matching patterns:	See String expressions.

message status:	See who invocation.

min:	See Special.

MIT AI lab:	See su invocation.

modem control:	See Control.

modified command invocation:	See Modified command invocation.

modified environment, running a program in:	See env invocation.

modifying scheduling priority:	See nice invocation.

multiplication:	See Numeric expressions.

name of operating system:	See uname invocation.

named pipe check:	See File type tests.

network node name:	See uname invocation.

newer-than file check:	See File characteristics tests.

newline echoing after kill:	See Local.

newline, echoing:	See Local.

newline, translating to crlf:	See Output.

newline, translating to return:	See Input.

next day:	See Options for date.

nice:	See nice invocation.

nl:	See Combination.

nln:	See Output.

no-op:	See true invocation.

node name:	See uname invocation.

noflsh:	See Local.

nohup:	See nohup invocation.

nohup.out:	See nohup invocation.

non-directory suffix, stripping:	See dirname invocation.

nonempty file check:	See File characteristics tests.

nonzero-length string check:	See String tests.

not-equal string check:	See String tests.

numeric expressions:	See Numeric expressions.

numeric field padding:	See date invocation.

numeric tests:	See Numeric tests.

ocrnl:	See Output.

odd parity:	See Control.

oddp:	See Combination.

ofdel:	See Output.

ofill:	See Output.

olcuc:	See Output.

older-than file check:	See File characteristics tests.

onlcr:	See Output.

onlret:	See Output.

onocr:	See Output.

operating system name:	See uname invocation.

operating system release:	See uname invocation.

operating system version:	See uname invocation.

opost:	See Output.

options for date:	See Options for date.

or operator <1>:	See Relations for expr.

or operator:	See Connectives for test.

ospeed:	See Special.

output settings:	See Output.

owned by effective gid check:	See Access permission tests.

owned by effective uid check:	See Access permission tests.

pad character:	See Output.

pad instead of timing for delaying:	See Output.

padding of numeric fields:	See date invocation.

parenb:	See Control.

parentheses for grouping:	See expr invocation.

parity:	See Combination.

parity errors, marking:	See Input.

parity, ignoring:	See Input.

parmrk:	See Input.

parodd:	See Control.

parsing date strings:	See Options for date.

pass8:	See Combination.

passwd entry, and su shell:	See su invocation.

PATH <1>:	See env invocation.

PATH:	See su invocation.

pathchk:	See pathchk invocation.

pattern matching:	See String expressions.

permission tests:	See Access permission tests.

pipe fitting:	See tee invocation.

portable file names, checking for:	See pathchk invocation.

POSIX.2:	See Introduction.

print name of current directory:	See pwd invocation.

print system information:	See uname invocation.

print terminal file name:	See tty invocation.

printenv:	See printenv invocation.

printf:	See printf invocation.

printing all or some environment variables:	See printenv invocation.

printing current user information:	See who invocation.

printing current usernames:	See users invocation.

printing groups a user is in:	See groups invocation.

printing real and effective uid and gid:	See id invocation.

printing text:	See echo invocation.

printing text, commands for:	See Printing text.

printing the current time:	See date invocation.

printing the effective UID:	See whoami invocation.

printing the hostname:	See hostname invocation.

printing user's login name:	See logname invocation.

priority, modifying:	See nice invocation.

prterase:	See Local.

pwd:	See pwd invocation.

quit:	See Characters.

raw:	See Combination.

read from stdin and write to stdout and files:	See tee invocation.

readable file check:	See Access permission tests.

real uid and gid, printing:	See id invocation.

redirection:	See Redirection.

regular expression matching:	See String expressions.

regular file check:	See File type tests.

relations, numeric or string:	See Relations for expr.

release of operating system:	See uname invocation.

remainder:	See Numeric expressions.

remote hostname:	See who invocation.

repeated output of a string:	See yes invocation.

restricted shell:	See su invocation.

return, ignoring:	See Input.

return, translating to newline <1>:	See Input.

return, translating to newline:	See Output.

root, becoming:	See su invocation.

rows:	See Special.

rprnt:	See Characters.

RTS/CTS flow control:	See Control.

same file check:	See File characteristics tests.

sane:	See Combination.

scheduling priority, modifying:	See nice invocation.

seconds since the epoch:	See Time directives.

set-group-id check:	See Access permission tests.

set-user-id check:	See Access permission tests.

setting the hostname:	See hostname invocation.

setting the time:	See Setting the time.

SHELL:	See su invocation.

shell utilities:	See Top.

size:	See Special.

sleep:	See sleep invocation.

socket check:	See File type tests.

software flow control:	See Input.

special characters:	See Characters.

special settings:	See Special.

speed:	See Special.

start:	See Characters.

sticky bit check:	See Access permission tests.

stop:	See Characters.

stop bits:	See Control.

strftime and date:	See date invocation.

string expressions:	See String expressions.

string tests:	See String tests.

strip directory and suffix from file names:	See basename invocation.

stripping non-directory suffix:	See dirname invocation.

stty:	See stty invocation.

su:	See su invocation.

substitute user and group ids:	See su invocation.

substr:	See String expressions.

subtraction:	See Numeric expressions.

successful exit:	See true invocation.

suffix, stripping from file names:	See basename invocation.

super-user, becoming:	See su invocation.

supplementary groups, printing:	See groups invocation.

susp:	See Characters.

swtch:	See Characters.

symbolic link check:	See File type tests.

symbolic links and pwd:	See pwd invocation.

syslog:	See su invocation.

system context:	See System context.

system information, printing:	See uname invocation.

system name, printing:	See hostname invocation.

tabn:	See Output.

tabs:	See Combination.

tandem:	See Input.

tee:	See tee invocation.

TERM:	See su invocation.

terminal check:	See File type tests.

terminal file name, printing:	See tty invocation.

terminal lines, currently used:	See who invocation.

terminal settings:	See stty invocation.

test:	See test invocation.

text, displaying:	See echo invocation.

time:	See Special.

time directives:	See Time directives.

time formats:	See date invocation.

time setting:	See Setting the time.

time units:	See sleep invocation.

time, printing or setting:	See date invocation.

tomorrow:	See Options for date.

tostop:	See Local.

true:	See true invocation.

tty:	See tty invocation.

Twenex:	See su invocation.

two-way parity:	See Control.

u, and disabling special characters:	See Characters.

uname:	See uname invocation.

uppercase, translating to lowercase:	See Input.

USER:	See su invocation.

user id, switching:	See su invocation.

user information, commands for:	See User information.

user name, printing:	See logname invocation.

usernames, printing current:	See users invocation.

users:	See users invocation.

utilities for shell programming:	See Top.

utmp:	See logname invocation.

valid file names, checking for:	See pathchk invocation.

version number, finding:	See Common options.

version of operating system:	See uname invocation.

vtn:	See Output.

werase:	See Characters.

wheel group, not supported:	See su invocation.

who:	See who invocation.

who am i:	See who invocation.

whoami:	See whoami invocation.

working context:	See Working context information.

working directory, printing:	See pwd invocation.

writable file check:	See Access permission tests.

write, allowed:	See who invocation.

xcase:	See Local.

XON/XOFF flow control:	See Input.

yes:	See yes invocation.

yesterday:	See Options for date.

zero-length string check:	See String tests.

|:	See Relations for expr.