- -
Turn off -v and -x, and turn off option processing.
- --
Used as the last option; -- turns off option processing
so that arguments beginning with - are not misinterpreted as options.
(For example, you can set $1 to -1.) If no arguments are given
after --, unset the positional parameters.
- -a
From now on, automatically mark variables for export
after defining or changing them.
- -b
Report background job status at termination, instead of waiting for next
shell prompt.
- -e
Exit if a command yields a nonzero exit status.
- -f
Do not expand filename metacharacters
(e.g., * ? [ ]). Wildcard expansion
is sometimes called globbing.
- -h
Locate commands as they are defined, and remember them.
- -k
Assignment of environment variables (var=value)
will take effect regardless of where they appear on the command line. Normally, assignments must precede the command name.
- -m
Monitor mode.
Enable job control; background jobs executes in a separate process
group. -m usually is set automatically.
- -n
Read commands, but don't execute. Useful for checking errors, particularly for shell scripts.
- -o [m]
List shell modes, or turn on mode m.
Many modes can be set by other options. The modes can be turned off
through the +o option. Modes are:
- allexport
Same as -a.
- braceexpand
Same as -B.
- emacs
Enter Emacs editing mode (on by default).
- errexit
Same as -e.
- hashall
Same as -h.
- histexpand
Same as -H.
- history
Default. Preserve command history.
- ignoreeof
Don't allow use of a single Ctrl-D (the end-of-file or EOF character) to log off; use the exit command to log off. This has the same
effect as setting the shell variable IGNOREEOF=1.
- interactive-comments
Treat all words beginning with #, and all
subsequent words, as comments.
- keyword
Same as -k.
- monitor
Same as -m.
- noclobber
Same as -C.
- noexec
Same as -n.
- noglob
Same as -f.
- notify
Same as -b.
- nounset
Same as -u.
- onecmd
Same as -t.
- physical
Same as -P.
- posix
Match POSIX standard.
- privileged
Same as -p.
- verbose
Same as -v.
- vi
Enable vi-style command-line editing.
- xtrace
Same as -x.
- +o [m]
Display modes or turn off mode m. See the
-o option for a list of modes.
- -p
Start up as a privileged user; don't process $HOME/.profile.
- -t
Exit after one command is executed.
- -u
Indicate an error when user tries to use a variable that is undefined.
- -v
Show each shell command line when read.
- -x
Show commands and arguments when executed, preceded by a
+ or the prompt defined by the PS4
shell variable. This provides step-by-step debugging of shell scripts.
(Same as -o xtrace.)
- -B
Default. Enable brace expansion.
- -C
Don't allow output redirection (>) to overwrite an existing file.
- -H
Default. Enable ! and !! commands.
- -P
Print absolute pathnames in response to
pwd. By default, bash
includes symbolic links in its response to pwd.