|
alias
|
alias [-p] [name[=value] ... ]
alias with no arguments or with the -p option
prints the list of aliases in the form alias
NAME=VALUE on standard output. Otherwise, an
alias is defined for each NAME whose VALUE is given. A trailing
space in VALUE causes the next word to be checked for alias
substitution when the alias is expanded. Alias returns true unless a
NAME is given for which no alias has been defined.
|
|
bg
|
bg [JOB_SPEC ...]
Place each JOB_SPEC in the background, as if it had been started
with &. If JOB_SPEC is not present, the shell's notion of the
current job is used.
|
|
bind
|
bind [-lpvsPVS] [-m keymap] [-f filename]
[-q name] [-u name] [-r keyseq]
[-x keyseq:shell-command]
[keyseq:readline-function or readline-command]
Bind a key sequence to a Readline function or a macro, or set a
Readline variable. The non-option argument syntax is equivalent to
that found in ~/.inputrc, but must be passed as
a single argument: bind "\C-x\C-r":
re-read-init-file.
|
|
break
|
break [N]
Exit from within a for, while
or until loop. If N is specified, break N levels.
|
|
builtin
|
builtin [shell-builtin [arg ...]]
Run a shell builtin. This is useful when you wish to rename a shell
builtin to be a function, but need the functionality of the builtin
within the function itself.
|
|
caller
|
caller [EXPR]
Returns the context of the current subroutine call. Without
EXPR, returns
$line $filename. With
EXPR, returns $line $subroutine
$filename; this extra information can be used to provide a
stack trace.
|
|
case
|
case WORD in [PATTERN [| PATTERN] [COMMANDS;;] ... esac
Selectively execute COMMANDS based upon
WORD matching
PATTERN. The `|' is used to separate
multiple patterns.
|
|
cd
|
cd [-L|-P] [dir]
Change the current directory to DIR.
|
|
command
|
command [-pVv]
command [arg ...]
Runs COMMAND with
ARGS ignoring shell functions. If you
have a shell function called `ls', and you wish to call the command
`ls', you can say "command ls". If the -p option is given, a default
value is used for PATH that is guaranteed to find all of the
standard utilities. If the -V or -v option is given, a string is
printed describing COMMAND. The -V option produces a more verbose
description.
|
|
compgen
|
compgen [-abcdefgjksuv] [-o option] [-A action]
[-G globpat] [-W wordlist] [-P prefix]
[-S suffix] [-X filterpat] [-F function]
[-C command] [WORD]
Display the possible completions depending on the options. Intended
to be used from within a shell function generating possible
completions. If the optional WORD
argument is supplied, matches against
WORD are generated.
|
|
complete
|
complete [-abcdefgjksuv] [-pr] [-o option]
[-A action] [-G globpat] [-W wordlist] [-P prefix]
[-S suffix] [-X filterpat] [-F function] [-C command]
[name ...]
For each NAME, specify how arguments are
to be completed. If the -p option is supplied, or
if no options are supplied, existing completion specifications are
printed in a way that allows them to be reused as input. The
-r option removes a completion specification for
each NAME, or, if no
NAMEs are supplied, all completion
specifications.
|
|
continue
|
continue [N]
Resume the next iteration of the enclosing FOR, WHILE or UNTIL loop.
If N is specified, resume at the
N-th enclosing loop.
|
|
declare
|
declare [-afFirtx] [-p] [name[=value] ...]
Declare variables and/or give them attributes. If no
NAMEs are given, then display the values
of variables instead. The -p option will display
the attributes and values of each NAME.
|
|
dirs
|
dirs [-clpv] [+N] [-N]
Display the list of currently remembered directories. Directories
find their way onto the list with the pushd
command; you can get back up through the list with the
popd command.
|
|
disown
|
disown [-h] [-ar] [JOBSPEC ...]
By default, removes each JOBSPEC argument
from the table of active jobs. If the -h option is
given, the job is not removed from the table, but is marked so that
SIGHUP is not sent to the job if the shell receives a SIGHUP. The
-a option, when JOBSPEC
is not supplied, means to remove all jobs from the job table; the
-r option means to remove only running jobs.
|
|
echo
|
echo [-neE] [arg ...]
Output the ARGs. If -n is specified, the trailing newline is
suppressed. If the -e option is given, interpretation of the
following backslash-escaped characters is turned on:
\a (alert, bell) | \b (backspace) | \c (suppress trailing newline) | \E (escape character) | \f (form feed) | \n (new line) | \r (carriage return) | \t (horizontal tab) | \v (vertical tab) | \\ (backslash) | \0nnn (the character whose ASCII code is NNN (octal). NNN can be
0 to 3 octal digits) |
You can explicitly turn off the interpretation of the above
characters with the -E option.
|
|
enable
|
enable [-pnds] [-a] [-f filename] [name...]
Enable and disable builtin shell commands. This allows you to use a
disk command which has the same name as a shell builtin without
specifying a full pathname. If -n is used, the
NAMEs become disabled; otherwise
NAMEs are enabled. For example, to use
the test found in $PATH instead of
the shell builtin version, type enable -n
test. On systems supporting dynamic loading, the
-f option may be used to load new builtins from the
shared object FILENAME. The
-d option will delete a builtin previously loaded
with -f. If no non-option names are given, or the
-p option is supplied, a list of builtins is
printed. The -a option means to print every builtin
with an indication of whether or not it is enabled. The
-s option restricts the output to the POSIX.2
`special' builtins. The -n option displays a list
of all disabled builtins.
|
|
eval
|
eval [ARG ...]
Read ARGs as input to the shell and
execute the resulting command(s).
|
|
exec
|
exec [-cl] [-a name] file [redirection ...]
Exec FILE, replacing this shell with the
specified program. If FILE is not
specified, the redirections take effect in this shell. If the first
argument is -l, then place a dash in the zeroth arg
passed to FILE, as login does. If the
-c option is supplied, FILE is executed with a null
environment. The -a option means to make set
argv[0] of the executed process to NAME.
If the file cannot be executed and the shell is not interactive,
then the shell exits, unless the shell option
execfail is set.
|
|
exit
|
exit [N]
Exit the shell with a status of N. If
N is omitted, the exit status is that of
the last command executed.
|
|
export
|
export [-nf] [NAME[=value] ...]
export -p
NAMEs are marked for automatic export to
the environment of subsequently executed commands. If the
-f option is given, the
NAMEs refer to functions. If no
NAMEs are given, or if
-p is given, a list of all names that are exported
in this shell is printed. An argument of -n says to
remove the export property from subsequent
NAMEs. An argument of --
disables further option processing.
|
|
false
|
false
Return an unsuccessful result.
|
|
fc
|
fc [-e ename] [-nlr] [FIRST] [LAST]
fc -s [pat=rep] [cmd]
fc is used to list or edit and re-execute commands from the history
list. FIRST and
LAST can be numbers specifying the range,
or FIRST can be a string, which means the
most recent command beginning with that string.
|
|
fg
|
fg [JOB_SPEC]
Place JOB_SPEC in the foreground, and
make it the current job. If JOB_SPEC is
not present, the shell's notion of the current job is used.
|
|
for
|
for NAME [in WORDS ... ;] do COMMANDS; done
The for loop executes a sequence of commands for
each member in a list of items. If in WORDS ...;
is not present, then in "$@" is assumed. For each
element in WORDS,
NAME is set to that element, and the
COMMANDS are executed.
|
|
function
|
function NAME { COMMANDS ; }
function NAME () { COMMANDS ; }
Create a simple command invoked by NAME
which runs COMMANDS. Arguments on the
command line along with NAME are passed
to the function as $0 .. $n.
|
|
getopts
|
getopts OPTSTRING NAME [arg]
Getopts is used by shell procedures to parse positional parameters.
|
|
hash
|
hash [-lr] [-p PATHNAME] [-dt] [NAME...]
For each NAME, the full pathname of the
command is determined and remembered. If the -p
option is supplied, PATHNAME is used as
the full pathname of NAME, and no path
search is performed. The -r option causes the shell
to forget all remembered locations. The -d option
causes the shell to forget the remembered location of each
NAME. If the -t option
is supplied the full pathname to which each
NAME corresponds is printed. If multiple
NAME arguments are supplied with
-t, the NAME is printed
before the hashed full pathname. The -l option
causes output to be displayed in a format that may be reused as
input. If no arguments are given, information about remembered
commands is displayed.
|
|
history
|
history [-c] [-d OFFSET] [n]
history -ps arg [arg...]
history -awrm [filename]
Display the history list with line numbers. Lines listed with with a
* have been modified. Argument of
N says to list only the last
N lines. The -c option
causes the history list to be cleared by deleting all of the
entries. The -d option deletes the history entry at
offset OFFSET. The -w
option writes out the current history to the history file;
-r means to read the file and append the contents
to the history list instead. -a means to append
history lines from this session to the history file. Argument
-n means to read all history lines not already read
from the history file and append them to the history list.
|
|
jobs
|
jobs [-lnprs] [JOBSPEC ...]
job -x COMMAND [ARGS]
Lists the active jobs. The -l option lists process
id's in addition to the normal information; the -p
option lists process id's only. If -n is given,
only processes that have changed status since the last notification
are printed. JOBSPEC restricts output to
that job. The -r and -s options
restrict output to running and stopped jobs only, respectively.
Without options, the status of all active jobs is printed. If
-x is given, COMMAND is
run after all job specifications that appear in
ARGS have been replaced with the process
ID of that job's process group leader.
|
|
kill
|
kill [-s sigspec | -n signum | -sigspec] pid | JOBSPEC ...
kill -l [sigspec]
Send the processes named by PID (or
JOBSPEC) the signal SIGSPEC. If SIGSPEC
is not present, then SIGTERM is assumed. An argument of
-l lists the signal names; if arguments follow
-l they are assumed to be signal numbers for which
names should be listed. Kill is a shell builtin for two reasons: it
allows job IDs to be used instead of process IDs, and, if you have
reached the limit on processes that you can create, you don't have
to start a process to kill another one.
|
|
let
|
let ARG [ARG ...]
Each ARG is an arithmetic expression to
be evaluated. Evaluation is done in fixed-width integers with no
check for overflow, though division by 0 is trapped and flagged as
an error. The following list of operators is grouped into levels of
equal-precedence operators. The levels are listed in order of
decreasing precedence.
|
|
local
|
local NAME[=VALUE] ...
Create a local variable called NAME, and
give it VALUE. local
can only be used within a function; it makes the variable
NAME have a visible scope restricted to
that function and its children.
|
|
logout
|
logout
Logout of a login shell.
|
|
popd
|
popd [+N | -N] [-n]
Removes entries from the directory stack. With no arguments, removes
the top directory from the stack, and cd's to the new top directory.
|
|
printf
|
printf [-v var] format [ARGUMENTS]
printf formats and prints ARGUMENTS under
control of the FORMAT.
FORMAT is a character string which
contains three types of objects: plain characters, which are simply
copied to standard output, character escape sequences which are
converted and copied to the standard output, and format
specifications, each of which causes printing of the next successive
argument. In addition to the standard printf(1) formats,
%b means to expand backslash escape sequences in
the corresponding argument, and %q means to quote
the argument in a way that can be reused as shell input. If the
-v option is supplied, the output is placed into
the value of the shell variable VAR rather than being sent to the
standard output.
|
|
pushd
|
pushd [dir | +N | -N] [-n]
Adds a directory to the top of the directory stack, or rotates the
stack, making the new top of the stack the current working
directory. With no arguments, exchanges the top two directories.
|
|
pwd
|
pwd [-LP]
Print the current working directory. With the -P
option, pwd prints the physical directory,
without any symbolic links; the -L option makes
pwd follow symbolic links.
|
|
read
|
read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [NAME ...]
The given NAMEs are marked readonly and
the values of these NAMEs may not be
changed by subsequent assignment. If the -f option
is given, then functions corresponding to the NAMEs are so marked.
If no arguments are given, or if -p is given, a
list of all readonly names is printed. The -a
option means to treat each NAME as an array variable. An argument of
-- disables further option processing.
|
|
readonly
|
readonly [-af] [NAME[=VALUE] ...]
readonly -p
The given NAMEs are marked readonly and
the values of these NAMEs may not be
changed by subsequent assignment. If the -f option
is given, then functions corresponding to the
NAMEs are so marked. If no arguments are
given, or if -p is given, a list of all readonly
names is printed. The -a option means to treat each
NAME as an array variable. An argument of
-- disables further option processing.
|
|
return
|
return [N]
Causes a function to exit with the return value specified by
N. If N is
omitted, the return status is that of the last command.
|
|
select
|
select NAME [in WORDS ... ;] do COMMANDS; done
The WORDS are expanded, generating a list
of words. The set of expanded words is printed on the standard
error, each preceded by a number. If in WORDS is
not present, in "$@" is assumed. The
PS3 prompt is then displayed and a line read from the
standard input. If the line consists of the number corresponding to
one of the displayed words, then NAME is
set to that word. If the line is empty,
WORDS and the prompt are redisplayed. If
EOF is read, the command completes. Any other value read causes
NAME to be set to null. The line read is
saved in the variable REPLY.
COMMANDS are executed after each
selection until a break command is executed.
|
|
set
|
set [--abefhkmnptuvxBCHP] [-o OPTION] [ARG...]
Sets internal shell options.
|
|
shift
|
shift [n]
The positional parameters from $N+1 ... are
renamed to $1 ... If N
is not given, it is assumed to be 1.
|
|
shopt
|
shopt [-pqsu] [-o long-option] OPTNAME [OPTNAME...]
Toggle the values of variables controlling optional behavior. The
-s flag means to enable (set) each
OPTNAME; the -u flag
unsets each OPTNAME. The
-q flag suppresses output; the exit status
indicates whether each OPTNAME is set or
unset. The -o option restricts the
OPTNAMEs to those defined for use with
set -o. With no options, or with the
-p option, a list of all settable options is
displayed, with an indication of whether or not each is set.
|
|
source
|
source FILENAME [ARGS]
Read and execute commands from FILENAME
and return. The pathnames in $PATH are used to find
the directory containing FILENAME. If any
ARGS are supplied, they become the
positional parameters when FILENAME is
executed.
|
|
suspend
|
suspend [-f]
Suspend the execution of this shell until it receives a SIGCONT
signal. The -f if specified says not to complain
about this being a login shell if it is; just suspend anyway.
|
|
test
|
test [expr]
Exits with a status of 0 (true) or 1 (false) depending on the
evaluation of EXPR. Expressions may be
unary or binary. Unary expressions are often used to examine the
status of a file. There are string operators as well, and numeric
comparison operators.
|
|
time
|
time [-p] PIPELINE
Execute PIPELINE and print a summary of
the real time, user CPU time, and system CPU time spent executing
PIPELINE when it terminates. The return
status is the return status of PIPELINE. The -p
option prints the timing summary in a slightly different format.
This uses the value of the TIMEFORMAT variable as the output format.
|
|
times
|
times
Print the accumulated user and system times for processes run from
the shell.
|
|
trap
|
trap [-lp] [ARG SIGNAL_SPEC ...]
The command ARG is to be read and
executed when the shell receives signal(s)
SIGNAL_SPEC. If
ARG is absent (and a single
SIGNAL_SPEC is supplied) or
-, each specified signal is reset to its original
value. If ARG is the null string each
SIGNAL_SPEC is ignored by the shell and
by the commands it invokes. If a
SIGNAL_SPEC is EXIT (0) the command ARG
is executed on exit from the shell. If a
SIGNAL_SPEC is DEBUG,
ARG is executed after every simple
command. If the -p option is supplied then the trap
commands associated with each SIGNAL_SPEC
are displayed. If no arguments are supplied or if only
-p is given, trap prints the list of commands
associated with each signal. Each
SIGNAL_SPEC is either a signal name in
signal.h or a signal number. Signal names are
case insensitive and the SIG prefix is optional. trap
-l prints a list of signal names and their corresponding
numbers. Note that a signal can be sent to the shell with
kill -signal $$.
|
|
true
|
true
Return a successful result.
|
|
type
|
type [-afptP] NAME [NAME ...]
Obsolete, see declare.
|
|
typeset
|
typeset [-afFirtx] [-p] name[=value]
Obsolete, see declare.
|
|
ulimit
|
ulimit [-SHacdfilmnpqstuvx] [limit
Ulimit provides control over the resources available to processes
started by the shell, on systems that allow such control.
|
|
umask
|
umask [-p] [-S] [MODE]
The user file-creation mask is set to
MODE. If MODE
is omitted, or if -S is supplied, the current value
of the mask is printed. The -S option makes the
output symbolic; otherwise an octal number is output. If
-p is supplied, and MODE
is omitted, the output is in a form that may be used as input. If
MODE begins with a digit, it is
interpreted as an octal number, otherwise it is a symbolic mode
string like that accepted by chmod(1).
|
|
unalias
|
unalias [-a] NAME [NAME ...]
Remove NAMEs from the list of defined
aliases. If the -a option is given, then remove all
alias definitions.
|
|
unset
|
unset [-f] [-v] [NAME ...]
For each NAME, remove the corresponding
variable or function. Given the -v, unset will only
act on variables. Given the -f flag, unset will
only act on functions. With neither flag, unset first tries to unset
a variable, and if that fails, then tries to unset a function. Some
variables cannot be unset; also see readonly.
|
|
until
|
until COMMANDS; do COMMANDS; done
Expand and execute COMMANDS as long as
the final command in the until
COMMANDS has an exit status which is not
zero.
|
|
wait
|
wait [N]
Wait for the specified process and report its termination status. If
N is not given, all currently active
child processes are waited for, and the return code is zero.
N may be a process ID or a job
specification; if a job spec is given, all processes in the job's
pipeline are waited for.
|
|
while
|
while COMMANDS; do COMMANDS; done
Expand and execute COMMANDS as long as
the final command in the while
COMMANDS has an exit status of zero.
|