1BASH_BUILTINS(1) General Commands Manual BASH_BUILTINS(1)
2
3
4
6 :, ., [, alias, bg, bind, break, builtin, caller, cd, command, compgen,
7 complete, compopt, continue, declare, dirs, disown, echo, enable, eval,
8 exec, exit, export, false, fc, fg, getopts, hash, help, history, jobs,
9 kill, let, local, logout, mapfile, popd, printf, pushd, pwd, read,
10 readarray, readonly, return, set, shift, shopt, source, suspend, test,
11 times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait -
12 bash built-in commands, see bash(1)
13
15 Unless otherwise noted, each builtin command documented in this section
16 as accepting options preceded by - accepts -- to signify the end of the
17 options. The :, true, false, and test/[ builtins do not accept options
18 and do not treat -- specially. The exit, logout, return, break, con‐
19 tinue, let, and shift builtins accept and process arguments beginning
20 with - without requiring --. Other builtins that accept arguments but
21 are not specified as accepting options interpret arguments beginning
22 with - as invalid options and require -- to prevent this interpreta‐
23 tion.
24 : [arguments]
25 No effect; the command does nothing beyond expanding arguments
26 and performing any specified redirections. The return status is
27 zero.
28
29 . filename [arguments]
30 source filename [arguments]
31 Read and execute commands from filename in the current shell en‐
32 vironment and return the exit status of the last command exe‐
33 cuted from filename. If filename does not contain a slash,
34 filenames in PATH are used to find the directory containing
35 filename, but filename does not need to be executable. The file
36 searched for in PATH need not be executable. When bash is not
37 in posix mode, it searches the current directory if no file is
38 found in PATH. If the sourcepath option to the shopt builtin
39 command is turned off, the PATH is not searched. If any argu‐
40 ments are supplied, they become the positional parameters when
41 filename is executed. Otherwise the positional parameters are
42 unchanged. If the -T option is enabled, . inherits any trap on
43 DEBUG; if it is not, any DEBUG trap string is saved and restored
44 around the call to ., and . unsets the DEBUG trap while it exe‐
45 cutes. If -T is not set, and the sourced file changes the DEBUG
46 trap, the new value is retained when . completes. The return
47 status is the status of the last command exited within the
48 script (0 if no commands are executed), and false if filename is
49 not found or cannot be read.
50
51 alias [-p] [name[=value] ...]
52 Alias with no arguments or with the -p option prints the list of
53 aliases in the form alias name=value on standard output. When
54 arguments are supplied, an alias is defined for each name whose
55 value is given. A trailing space in value causes the next word
56 to be checked for alias substitution when the alias is expanded.
57 For each name in the argument list for which no value is sup‐
58 plied, the name and value of the alias is printed. Alias re‐
59 turns true unless a name is given for which no alias has been
60 defined.
61
62 bg [jobspec ...]
63 Resume each suspended job jobspec in the background, as if it
64 had been started with &. If jobspec is not present, the shell's
65 notion of the current job is used. bg jobspec returns 0 unless
66 run when job control is disabled or, when run with job control
67 enabled, any specified jobspec was not found or was started
68 without job control.
69
70 bind [-m keymap] [-lpsvPSVX]
71 bind [-m keymap] [-q function] [-u function] [-r keyseq]
72 bind [-m keymap] -f filename
73 bind [-m keymap] -x keyseq:shell-command
74 bind [-m keymap] keyseq:function-name
75 bind [-m keymap] keyseq:readline-command
76 bind readline-command-line
77 Display current readline key and function bindings, bind a key
78 sequence to a readline function or macro, or set a readline
79 variable. Each non-option argument is a command as it would ap‐
80 pear in a readline initialization file such as .inputrc, but
81 each binding or command must be passed as a separate argument;
82 e.g., '"\C-x\C-r": re-read-init-file'. Options, if supplied,
83 have the following meanings:
84 -m keymap
85 Use keymap as the keymap to be affected by the subsequent
86 bindings. Acceptable keymap names are emacs, emacs-stan‐
87 dard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command,
88 and vi-insert. vi is equivalent to vi-command (vi-move
89 is also a synonym); emacs is equivalent to emacs-stan‐
90 dard.
91 -l List the names of all readline functions.
92 -p Display readline function names and bindings in such a
93 way that they can be re-read.
94 -P List current readline function names and bindings.
95 -s Display readline key sequences bound to macros and the
96 strings they output in such a way th