BASH(1) General Commands Manual BASH(1) bash -- GNU Bourne-Again SHell bash [] [_ | ] Bash is Copyright (C) 1989-2025 by the Free Software Foundation, Inc. Bash , , , . , Unix. Bash Korn C (ksh csh). POSIX - ' , Unix. Bash Shell and Utilities IEEE POSIX ( IEEE 1003.1). POSIX Bash ( - posix) , , . . . , , , posix bash. Bash POSIX , set, -o, . , bash : -c -c, , , _. _ , ' $0, -- . ' $0 , . -i -i, . -l bash , (. ). -r -r, (. ). -s -s , . . -D , $, . , , C POSIX. -n. . [-+]O [_] _ , shopt (. ). _, -O ; +O . _ , , shopt. +O, , . -- -- . - -- (. ) , . - --. , bash . , . --debugger , . (. extdebug shopt ). --dump-po-strings -D, GNU gettext "po" ( '). --dump-strings , -D. --help <<>>. --init-file --rcfile Execute commands from file instead of the standard personal initialization file ~/.bashrc if the shell is interactive (see INVOCATION below). --login -l. --noediting GNU readline , . --noprofile Do not read either the system-wide startup file /etc/profile or any of the personal initialization files ~/.bash_profile, ~/.bash_login, or ~/.profile. By default, bash reads these files when it is invoked as a login shell (see INVOCATION below). --norc Do not read and execute the personal initialization file ~/.bashrc if the shell is interactive. This option is on by default if the shell is invoked as sh. --posix posix; bash , POSIX , --restricted (. ). --verbose -v. --version bash <<>>. , -c, -s, , . bash , $0 , . Bash , . bash . , 0. bash . , PATH. A login shell , -, , --login. , , ( -s), -c, ' ( isatty(3)), , -i. bash , Bash PS1, $- i, . , bash . , , bash . , . When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior. When an interactive login shell exits, or a non-interactive login shell executes the exit builtin command, bash reads and executes commands from the file ~/.bash_logout, if it exists. When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. The --norc option inhibits this behavior. The --rcfile file option causes bash to use file instead of ~/.bashrc. bash , , , BASH_ENV , , , , , . Bash , : if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi PATH . If bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the --login option, it first attempts to read and execute commands from /etc/profile and ~/.profile, in that order. The --noprofile option inhibits this behavior. When invoked as an interactive shell with the name sh, bash looks for the variable ENV, expands its value if it is defined, and uses the expanded value as the name of a file to read and execute. Since a shell invoked as sh does not attempt to read and execute commands from any other startup files, the --rcfile option has no effect. A non-interactive shell invoked with the name sh does not attempt to read any other startup files. sh, bash posix . bash posix --posix, POSIX . ENV, , . - . Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by the historical and rarely-seen remote shell daemon, usually rshd, or the secure shell daemon sshd. If bash determines it is being run non-interactively in this fashion, it reads and executes commands from ~/.bashrc, if that file exists and is readable. Bash does not read this file if invoked as sh. The --norc option inhibits this behavior, and the --rcfile option makes bash use a different file instead of ~/.bashrc, but neither rshd nor sshd generally invoke the shell with those options or allow them to be specified. () (), -p, , , SHELLOPTS, BASHOPTS, CDPATH GLOBIGNORE, , , . -p, , . . . whitespace space , isspace(3) (true). , . . A , - , . , , identifier. , , , . : | & ; ( ) < > space tab newline , . : || & && ; ;; ;& ;;& ( ) | |& -- , . , , (. ), case select ( in) for ( in do): ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] . , . , , . , . 128+n, n. , | |&. : [time [-p]] [ ! ] 1 [ [|||&] 2 ... ] 1 ' 2. ' - , (. ). |& , 1, , ' 2 ; 2>&1 |. - , 1. , pipefail. pipefail, () , , , . !, , . , , . time, . -p , POSIX posix, time , "-". TIMEFORMAT , ; . TIMEFORMAT . posix, time . , . TIMEFORMAT . , , , . . , . lastpipe shopt (. shopt ), , . , ;, &, && ||, , , ;, & < >. && || . ; &, . . &, . , 0. . , ;, . , . . && || . . 1 && 2 2 , 1 (). OR 1 || 2 2 , 1 . AND OR . . , . () ( , ). , , . -- . { ; } . . . -- . , ( ), { } , . , . (()) . , 0; 1. , , , . , , 0. [[ ]] (true) (false). , . [[ ]] . , , , , . , -f, , . [[, < > . == !=, , , extglob. = ==. nocasematch, . 0, (==) (!=) , 1 . - , , - . , =~, , as == and !=. , POSIX ( POSIX regcomp regexec, regex(3)). 0, , 1 . , 2. nocasematch, . - , . , - , . , . , . , - . ' ^ $, . - BASH_REMATCH , . BASH_REMATCH 0 . , , BASH_REMATCH. BASH_REMATCH n , n- . Bash BASH_REMATCH ; . , : ( ) . . ! True, false. 1 && 2 True, , 1 2, true. 1 || 2 True, 1 2 true. && || 2 , 1 . for [ [ in ... ] ; ] do ; done -, , in, . , . in, for (. ). . in , , 0. for (( 1 ; 2 ; 3 )) [;] do ; done , 1 , . , expr2 . , 2 , 3. , , 1. , , - . break continue (. ). select [ in ] ; do ; done in. . , . in, (. ). select PS3 . , , select . , . (EOF), select 1. - , (null). REPLY. , break. select , , , . case in [ [(] [ | ] ... ) ;; ] ... esac case , . , , , , . , , , , . nocasematch, . ' . , case . ;;, . ;& ;;, ' . ;;& ;;, , , - ' , , , . , . , . if ; then ; [ elif ; then ; ] ... [ else ; ] fi if . -- then . elif , , then . else , . , . while -1; do -2; done until -1; do -2; done while -2, -1 . until while, : -2 , -1 . while until -2 , . -- , coproc. , &. , , , . : coproc [] [] . , (. ). . , COPROC. : coproc { []; } , ' COPROC, , . , '. coproc , : , , . , ; , . - (. ) , . ' , , [0]. ' , , [1]. - , (. ). . , , . , , _PID. wait. , coproc . . , . : fname () _ [] function _ [()] _ [] _. function '. function, '. _ (. ). , , { }, - , function, , . _ , _. posix _ POSIX - , - (. ), , . , . . (. .) , shopt interactive_comments (. ), #, . , . . interactive_comments . interactive_comments . . , . -- , . (. ), , !, . : , , . (\) . - , < >. \< > \< > (, , , ). . , . , , , $, `, \ , , !. posix, ! , . $ ` . , : $, `, ", \ < >. , , . . , !, . ! . * @ (. ). $'' , . , , ANSI C. , , : \a () \b backspace \e \E \f \n \r \t \v \\ \' \" \? \nnn , nnn ( ). \xHH , HH ( ). \uHHHH Unicode (ISO/IEC 10646), HHHH ( ). \UHHHHHHHH Unicode (ISO/IEC 10646), HHHHHHHH ( ). \cx control-x. , , . , ($"") , . gettext LC_MESSAGES TEXTDOMAIN. C POSIX, , , , . , , . noexpand_translation shopt, , . . shopt . , . , , . , . , . declare (. declare ). export readonly . , . . , unset (. ). =[] , . , , , (. ). integer, , $((...)) (. ). . alias, declare, typeset, export, readonly local ( ). posix ' . "+=" . , declare, . "+=" , integer, , . , . "+=" - (. Arrays ), ( "="), , , ( ), - . , , . nameref -n declare local (. declare local ) nameref . . nameref, , ( nameref) , nameref. nameref , . , , declare -n ref=$1 nameref ref, , . , , , $1. for nameref, , . - nameref. nameref - -. nameref -n unset. , unset nameref , nameref. , , (. ). -- , , 0. . set. . (. ). , , (. ). $ ' ($1-$9) $0 (. ). . . . . * ($*) , . , . , , . , , , IFS. , "$*" "$1c$2c...", c -- IFS. IFS , . IFS , ' . @ ($@) , . , . , . , , , , . , . , "$@" "$1" "$2" ... , ' , ' . , "$@" $@ (, ). # ($#) . ? ($?) . - ($-) , , set, ( -i). $ ($$) . , . ! ($!) , , bg (. JOB CONTROL ). 0 ($0) . . bash , $0 . bash -c, $0 , . , , bash, . : _ ($_, ) , . _ , , , , , . , , , . , , , . $_ , . BASH , bash. BASHOPTS . -s shopt (. ). , ' BASHOPTS, , shopt , . , bash - . , . . BASHPID bash. , , , bash, $$. BASHPID . BASHPID, , . BASH_ALIASES - , , alias. , , ; . BASH_ALIASES, , . BASH_ARGC -, bash. ( , . source) . , BASH_ARGC. BASH_ARGC (. extdebug shopt). extdebug , , , extdebug , . BASH_ARGC ; , . BASH_ARGV -, bash. ; - . , BASH_ARGV. BASH_ARGV (. extdebug shopt). extdebug , , , extdebug , . BASH_ARGV , . BASH_ARGV0 ( $0; . 0 ). BASH_ARGV0 $0 . BASH_ARGV0, , . BASH_CMDS - , - , e hash. , , ' -; -. BASH_CMDS, , . BASH_COMMAND , , , , . BASH_COMMAND, , . BASH_EXECUTION_STRING -c. BASH_LINENO -, , FUNCNAME. ${BASH_LINENO[$i]} (${BASH_SOURCE[$i+1]}), ${FUNCNAME[$i]} ( ${BASH_LINENO[$i-1]}, ). LINENO. BASH_LINENO , . BASH_LOADABLES_PATH , , enable. BASH_MONOSECONDS , , . BASH_MONOSECONDS , , . BASH_REMATCH -, =~ [[. 0 , . n , n- . BASH_SOURCE -, , - FUNCNAME. ${FUNCNAME[$i]} ${BASH_SOURCE[$i]} ${BASH_SOURCE[$i+1]}. BASH_SOURCE , . BASH_SUBSHELL , . 0. BASH_SUBSHELL, , . BASH_TRAPSIG , , . . trap , . BASH_VERSINFO -, bash. : BASH_VERSINFO[0] (). BASH_VERSINFO[1] (). BASH_VERSINFO[2] . BASH_VERSINFO[3] . BASH_VERSINFO[4] (, beta). BASH_VERSINFO[5] MACHTYPE. BASH_VERSION , bash (: 5.2.37(3)-release). COMP_CWORD ${COMP_WORDS} , . , (. ). COMP_KEY ( ), . , (. ). COMP_LINE . , (. ). COMP_POINT . , ${#COMP_LINE}. , (. ). COMP_TYPE , , : TAB -- , ? -- , ! -- , @ -- , , % -- . , , (. ). COMP_WORDBREAKS , readline . COMP_WORDBREAKS, , . COMP_WORDS - (. ), . , readline, COMP_WORDBREAKS, . , (. ). COPROC - (. ), (. ). DIRSTACK - (. ), . , , dirs. , pushd popd. . DIRSTACK , , . EPOCHREALTIME Unix (. time(3)) . EPOCHREALTIME . EPOCHREALTIME , , . EPOCHSECONDS Unix ( time(3)). EPOCHSECONDS . EPOCHSECONDS , , . EUID . . . FUNCNAME -, . 0 - , . ( ) "main". , . FUNCNAME . FUNCNAME , , . BASH_LINENO BASH_SOURCE. %FUNCNAME BASH_LINENO BASH_SOURCE . , ${FUNCNAME[$i]} ${BASH_SOURCE[$i+1]} ${BASH_LINENO[$i]}. caller. GROUPS -, , . GROUPS . GROUPS , , . HISTCMD . HISTCMD . HISTCMD , , . HOSTNAME . HOSTTYPE , ', bash. . LINENO , ( 1) . , . LINENO , , . MACHTYPE , , bash , GNU --. . MAPFILE - ( ), , mapfile, . OLDPWD , cd. OPTARG , getopts (. ). OPTIND , getopts (. ). OSTYPE , , bash. . PIPESTATUS - (. Arrays ), , (. ). Bash PIPESTATUS , , , , ( , [[ (( , , . PPID . . PWD , cd. RANDOM , , 0 32767. RANDOM . . RANDOM , , . READLINE_ARGUMENT - , readline, "bind -x" (. ), . READLINE_LINE readline "bind -x" (. ). READLINE_MARK ( ) readline "bind -x" (. ). . READLINE_POINT readline "bind -x" (. ). REPLY , read, . SECONDS , . SECONDS, , . . SECONDS , , . SHELLOPTS . -o set (. ). , ' SHELLOPTS, , set -o , . , bash - . , . . SHLVL , bash. SRANDOM Each time it is referenced, this variable expands to a 32-bit pseudo-random number. The random number generator is not linear on systems that support /dev/urandom or arc4random(3), so each returned number has no relationship to the numbers preceding it. The random number generator cannot be seeded, so assignments to this variable have no effect. If SRANDOM is unset, it loses its special properties, even if it is subsequently reset. UID . . . . bash . . BASH_COMPAT . . (, 4.2) (, 42), . BASH_COMPAT , . BASH_COMPAT , , , . B . , 4.2 42 , compat42 shopt 42. . BASH_ENV , bash , , , , . BASH_ENV , , . PATH. BASH_XTRACEFD , , bash , "set -x" , . BASH_XTRACEFD . BASH_XTRACEFD , . , BASH_XTRACEFD 2 ( ) . CDPATH cd. , , , cd. : ".:~:/usr". CHILD_MAX , . Bash , ' POSIX ( 8192), . . COLUMNS select . , checkwinsize SIGWINCH. COMPREPLY -, bash , , (. ). . EMACS bash , "t", , Emacs, . ENV BASH_ENV (. ) posix. EXECIGNORE (. ), , PATH. , PATH. [, test [[. EXECIGNORE . , , . extglob. FCEDIT fc. FIGNORE , (. READLINE ). , FIGNORE, . ".o:~". FUNCNEST , . , , . GLOBIGNORE , , . GLOBIGNORE, . extglob. GLOBSORT . . , , LC_COLLATE. , ' +, , -, , . : name, numeric, size, mtime, atime, ctime blocks, , , , , , , inode . - , , (, ), . , -mtime ( ). numeric , , (, , "2" ' "10", ). numeric, , , ' , , . nosort ; bash , - -. , name, + , - . - . HISTCONTROL , . ignorespace, , . ignoredups , , , . ignoreboth ignorespace ignoredups. erasedups , , . , , . HISTCONTROL , , HISTIGNORE. , HISTCONTROL. , HISTCONTROL. , . HISTFILE The name of the file in which command history is saved (see HISTORY below). Bash assigns a default value of ~/.bash_history. If HISTFILE is unset or null, the shell does not save the command history when it exits. HISTFILESIZE , . , , , , , -- . , , , . history. 0, . ' . HISTSIZE . HISTIGNORE , , , . HISTIGNORE, . ' , (bash "*"). , HISTCONTROL. , "&" . "&"; . , HISTIGNORE. , . extglob. HISTIGNORE HISTCONTROL. "&" "ignoredups", , "[ ]*" "ignorespace". , , "ignoreboth". HISTSIZE , (. ). 0, . ', ( ). 500. HISTTIMEFORMAT (null), strftime(3) , ' , history. , , . , . HOME ; cd. . HOSTFILE Contains the name of a file in the same format as /etc/hosts that should be read when the shell needs to complete a hostname. The list of possible hostname completions may be changed while the shell is running; the next time hostname completion is attempted after the value is changed, bash adds the contents of the new file to the existing list. If HOSTFILE is set, but has no value, or does not name a readable file, bash attempts to read /etc/hosts to obtain the list of possible hostname completions. When HOSTFILE is unset, bash clears the hostname list. IFS (Internal Field Separator), read. . "". IGNOREEOF EOF . , EOF, , bash . , , 10. , EOF . INPUTRC The filename for the readline startup file, overriding the default of ~/.inputrc (see READLINE below). INSIDE_EMACS , bash , , TERM. LANG , , LC_. LC_ALL LANG - LC_, . LC_COLLATE , , , . LC_CTYPE . LC_MESSAGES , , $. LC_NUMERIC , . LC_TIME , . LINES select . , checkwinsize SIGWINCH. MAIL , MAILPATH, bash Maildir. MAILCHECK ( ) bash . 60 . , . , , . MAILPATH , . , , , "?". $_ , . : MAILPATH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"' Bash ( ), , , (, /var/mail/$USER). OPTERR 1, bash , getopts (. ). OPTERR 1 , . PATH . , (. ). (null) PATH . ' . , bash. /usr/local/bin:/usr/local/sbin:.if 0<78n .br /usr/bin:/usr/sbin:/bin:/sbin POSIXLY_CORRECT bash, posix , , --posix. , bash posix , "set -o posix" posix, , . PROMPT_COMMAND , , . , , , . PROMPT_DIRTRIM , , \w \W (. ). . PS0 (. ) . PS1 (. ) . -- "\s-\v\$ ". PS2 , PS1, . -- "> ". PS3 select (. ). PS4 , PS1, , bash . PS4, , . "+ ". SHELL . , bash . TIMEFORMAT , , time. % escape-, . Escape- ; ' . %% %. %[p][l]R . %[p][l]U , . %[p][l]S , . %P , (%U + %S) / %R. ' p , , . 0 , , . time ; p, 6, 6. p , precision . ' l , , MMmSS.FFs. p , . , bash , $'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'. , . . TMOUT , read , . select , TMOUT , . , . Bash , . TMPDIR , bash , bash . auto_resume , . , , , . : , , , . , , jobs. exact, ; substring, . substring %? (. ). - (, prefix), ; %. histchars , , (. ). -- , , "!". , "^". ' , , . ' -- , "#", , , , ' . . ' , . bash -. - . declare. , , . , (. ). . . , ' . , , . , , 0. , , , . . Bash , - []= . , , . , declare -a (. ). declare -a [] ; . declare -A . - declare readonly. . =(1 ... n), []=. . , , , , , , . , ' , . , , , , , . . , , , : =( 1 1 2 2 ...). , =( [1]=1 [2]=2 ...). , ; . /, , ; . declare. []=, . , ' , , . , ' , -1 . "+=" ; . . - ${[]}. ' . @ *, , . -, . , ${[*]} , IFS, ${[@]} . , ${[@]} . , ' , ' . * @ (. ). ${#[]} ${[]}. * @, . , , , , , ' , -1 . - 0. - - . , bash . - , . . () , . ${![@]} ${![*]} , - . @ * . unset. unset [] , , . ' . - . unset , , . unset [], * @, -, , , * @. , * @. , unset , . , , unset, , (, unset a[4]), . , (: unset 'a[4]'). declare, local readonly -a -A . , -A. read -a , , . set declare , . (, mapfile); . , . -. , . : , , , , , , . : ; , , ( ); ; . , , : . , , . . , , , . , ; . "$@" "${[@]}", , , $* ${[*]}, (. ). , . , , . , , ' , , , ' . , . . . ; . : a{d,c,b}e "ade ace abe". x..y[..], x y , , ' , . , x y, . x y , , , . , , x y, , C. , x y ( ). , . 1 -1, . - . , . . Bash . . . A "{" Q, , , . , "${" "}". , , , , : mkdir /usr/local/src/bash/{old,new,dist,bugs} chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} sh. sh , , . Bash . , sh "file{1,2}" , . bash "file1 file2" . sh, bash +B +B set (. ). ( "~"), ( , ) -. - , - . , HOME. HOME , , . - , ' . - "~+", PWD -. - "~-", OLDPWD, . - N, "+" "-", - , dirs, , -, . , -, "+" "-", "+". , , . , - . bash - : =. , . , PATH, MAILPATH CDPATH -- . , Bash , ( ), ' . posix Bash , . "$" , . , , , ', , . , << "}" >>, , , . ${} . , , , , . , (. ) (). (!) nameref, . Bash , ; , . . , , . nameref, , , . ${!*} ${![@]}, . , . , , . , (, :-), bash , . , , . ${:-} . , . . ${:=} . , , . . ${:?} , . , ( , ) , , , . , , ' . . ${:+} . , . . . ${:} ${::} . , , . @ *, @ * , , . : ( ), , , , . , 0. , , 0. (. ). ' , . ' , , , . , ' , :-. @ *, , . ' . , -1 ( 0, ). ' , . @ *, , ${[]}. ' , . ' , . . , . , , 1. 0 , $0. ${!*} ${!@} . , . IFS. @ , . ${![@]} ${![*]} . -, () , . , 0, , , . @ , . ${#} . . * @, . * @, . -- ' , . ' , -1 . ${#} ${##} . , . , . , , ( "#" ) ( "##" @ *, , . - @ *, , . ${%} ${%%} . , . , . , , ( "%" ) ( "%%" @ *, , . - @ *, , . ${//} ${///} ${/#/} ${/%/} . , . . , , , , . . , ( ), . # ( ), . % ( ), . , , / . patsub_replacement shopt, & . - , , . & ; & . ; \\ . , , . & ; &, &, . , , , , , , , , , . nocasematch, . @ *, , . - @ *, , . ${^} ${^^} ${,} ${,,} . . , . bash , . , . . "^" , , ; "," . ^ , , ; ^^ ,, , . , ?, , - . @ *, , . - @ *, , . ${@} . , . : U , , () (). u , , (), . L , , () (). Q , , , . E , , , $'...'. P , , (. ). A declare, , , . K , , , - (. ). , . a , , . k K-, . @ *, , . - @ *, , . . . : $() () ``. Bash , . , . $(cat ) , , $(< ). , , $, ` \. , , . $(), ; . : ${c ;} , , . c , , |, , ' ( , ). Bash , . - command (, exit ). : , , return ; , , , . |, REPLY , - , , , . Bash REPLY REPLY , , - . . . , . . : $(()) , , , . , . . Bash , , 0. . . , bash , , , ' . , . <() >(). , . , . >(), . <(), , , . < > , . , (FIFO) /dev/fd. , , . , , . , , . IFS , . IFS - , (. ), ' IFS. , IFS, space . IFS , , , IFS. IFS , , (. ) . IFS , . IFS IFS, - IFS , , IFS , . IFS , - IFS, IFS, - IFS, . , , IFS, . IFS . ("" '') . , , , . , ; . , , , . , "-d''" "-d" . , -f, bash *, ? [. , , -- , (. ) GLOBSORT. , nullglob , . nullglob , , . failglob , , bash . nocaseglob , . , "." at the start of a name or immediately following a slash must be matched explicitly, unless the shell option dotglob is set. In order to match the filenames . and .., the pattern must begin with "." (, ".?"), even if dotglob is set. If the globskipdots shell option is enabled, the filenames . and .. never match, even if the pattern begins with a ".". , "." . , , . . shopt , nocaseglob, nullglob, globskipdots, failglob dotglob. The GLOBIGNORE shell variable may be used to restrict the set of file names matching a pattern. If GLOBIGNORE is set, each matching file name that also matches one of the patterns in GLOBIGNORE is removed from the list of matches. If the nocaseglob option is set, the matching against the patterns in GLOBIGNORE is performed without regard to case. The filenames . and .. are always ignored when GLOBIGNORE is set and not null. However, setting GLOBIGNORE to a non-null value has the effect of enabling the dotglob shell option, so all other filenames beginning with a "." . , ".", , ".*" GLOBIGNORE. dotglob , GLOBIGNORE. extglob. GLOBSORT , , . - , ' , , , . NUL . ; . , . : * - , (null) . globstar *, * , , . /, * . ? - . [...] - , . . , , ; - , , . [ ! ^, - . - , . ] , . , , LC_COLLATE LC_ALL, . , [a-d] [abcd], LC_COLLATE LC_ALL globasciiranges. : [::], , POSIX : alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit - , . word , _. , [=c=], ( ), c. , [..] . extglob shopt, . _ - , |. : ?(_) . *(_) , . +(_) . @(_) . !(_) , . extglob , . , extglob , , . dotglob , : dotglob , , ".", but . and .. must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames beginning with "." ".". If the globskipdots shell option is enabled, the filenames . and .. never appear in the set. As above, "." . , , . . \, ' ", , . , , . , , , , , . exec, . , . , . , , {-}. , , >&- <&-, ' , 9, -. >&- <&- {-}, - , . {-}, , exec. varredir_close. , , "<", <<>> ( 0). ">", <<>> ( 1). , , , , , , , , , . , bash . . , ls > dirlist 2>&1 dirlist, ls 2>&1 > dirlist dirlist, , dirlist. bash -, , . , bash, , bash . , bash , , . /dev/fd/_ _ , _. /dev/stdin 0. /dev/stdout 1. /dev/stderr 2. /dev/tcp// -, -- , bash TCP. /dev/udp// -, -- , bash UDP. . , 9, , , . , , , n ( 0), n . : [n]< , , , n ( 1), n . , ; , . : [n]> > noclobber set, , , , . >| > noclobber set, bash , , , . , , , n ( 1), n . , . : [n]>> ( 1), ( 2) , . : &> >& . > 2>&1 , -. , (. ). ( 1), ( 2) , . : &>> >> 2>&1 (. ). , , , ( ). , ( n, n) . : [n]<<[-] , , . , , . , , : , , \< > , \, $ ` \; , . <<-, , . . , \ : ', . , , ' . . : [n]<<< , , , . . ( n, n). [n]<& . , n . , , . -, n . n , ( 0). [n]>& . n, ( 1). , , . -, n . , n, -, . [n]<&- n ( 0), n . n. , [n]>&- n ( ), n . [n]<> , , n 0, n . , . , . , alias unalias (. ). , , . , , . , . /, $, ` =, - , . - , . , , , , . , , , ls ls -F, bash . , . alias. unalias. . , (. ). , expand_aliases shopt (. shopt ). , , . Bash , , - . , , . , , , . , . . , , . , , , . , alias . . , , , - . , , ' . ; ( ). . #. 0 . FUNCNAME . , , : DEBUG RETURN (. trap ) , trace (. declare ) -o functrace set ( DEBUG RETURN), ERR , -o errtrace. , , local ( ). . local, ( , ). , , , , "global" , . , local declare , . "shadow" <<>> , . , , , , , : , . . . , . , , , , , <<>> . , , <<>> , , . , 1, 1 2, , 2, 1, - . unset : , unset ; , , - , , . , ( ), . , - . , - , , (. , localvar_unset ). FUNCNEST, , . , , . return, . return , ; , return. , ' RETURN. , #. -f declare typeset. -F declare typeset (, ', - , extdebug). , (, ), -- -f export. -f unset. . FUNCNEST. , bash . , , (. let declare, ((, for, [[ ). , 0 . , , , C. , . . id++ id-- ++ -- - + ! ~ ** * / % , , + - , << >> <= >= < > == != & <<>> ^ | <<>> && <<>> || <<>> expr?expr:expr = *= /= %= += -= <<= >>= &= ^= |= expr1 , expr2 ; . . , <>, x -- , , . , , 0, . , , integer declare -i . 0. ' integer. C . 0 . 0x 0X . , [#]n, ' 2 64, , n -- . # , 10. n, , , 9 , , @ _, . , 36, , 10 35. . . . [[ test [ . test [ ; . , , , . , . . , . Bash handles several filenames specially when they are used in expressions. If the operating system on which bash is running provides these special files, bash will use them; otherwise it will emulate them internally with this behavior: If any file argument to one of the primaries is of the form /dev/fd/n, then bash checks file descriptor n. If the file argument to one of the primaries is one of /dev/stdin, /dev/stdout, or /dev/stderr, bash checks file descriptor 0, 1, or 2, respectively. , , , , , . [[ posix, < > . posix, test ASCII. -a , . -b , . -c , . -d , . -e , . -f , . -g , . -h , . -k , "sticky" . -p , (FIFO). -r , . -s , . -t _ , _ . -u , --. -w , . -x , . -G , . -L , . -N , . -O , . -S , . -o _ , _. . -o set . -v True, _ ( ). _ -- @ *, true, - . _ -- @ *, true, . -R _ , _ . -z , . -n , . 1 == 2 1 = 2 , . POSIX = test. [[, , ( ). 1 != 2 , . 1 < 2 , 1 2 . 1 > 2 , 1 2 . 1 -ef 2 , 1 2 inode. 1 -nt 2 , 1 ( ) 2, 1 , 2 -- . 1 -ot 2 , 1 2, 2 , -- . 1 OP 2 OP : -eq, -ne, -lt, -le, -gt -ge. <<>>, 1 , , , , 2, . 1 2 ' . [[, 1 2 (. ). , [[ 1 2, , , 0. , , , . 1. , ( ), . 2. , . , , -- . 3. , . 4. = , , , , . , . ( ), . . - , , . , , . . , , . . , , . , . , ' , . , . , , . , . , . , , , bash PATH , . Bash ' - (. ). PATH , -. , command_not_found_handle. , , , , , . , 127. , , . 0 , -- , . , , , , , , . Bash , , , . , , , , , ' (. ), . , #!, . , . ' , , - , . , : o , , exec o , cd, pushd popd . o , umask . o , trap. o , set . o , . o , ( ) set. o , shopt. o , alias. o , , $$ PPID. , , , . , . o , . o . o . o , , , , . o , , , , , , . , , . . , , , , , , , , , . , , , , , lastpipe, . , , . posix, , , -e . posix, bash -e. . inherit_errexit , , , POSIX. If a command is followed by a & and job control is not active, the default standard input for the command is the empty file /dev/null. Otherwise, the invoked command inherits the file descriptors of the calling shell as modified by redirections. , . - :=value. . , . . export, declare -x unset. , , . , - , , , , unset, unset export -n. - , PARAMETERS, ' , , . , . , ' . -k (. set ), , , , . bash , _ . . , waitpid . 0 255. , , , 125, . . , , . , , , . , , . N, bash 128+N. , , , 127. , , 126. , . 0 (), , (), . 2, , -- , . $?. bash , . , . . exit . bash , SIGTERM (, kill 0 ) SIGINT (, wait). bash SIGINT, - . bash SIGQUIT. , bash SIGTTIN, SIGTTOU SIGTSTP. trap , . , bash, , , , trap , . , SIGINT SIGQUIT . , , SIGTTIN, SIGTTOU SIGTSTP. SIGHUP. SIGHUP . SIGCONT, , SIGHUP (. JOB CONTROL , ). , disown (. ) , SIGHUP, disown -h. huponexit shopt, , , bash SIGHUP. bash , , , . bash wait, , , wait 128, . , bash , , SIGINT (, ^C), , , . , , , ^C SIGINT . bash , , . , bash , , , , . , bash . . JOB CONTROL , . bash SIGINT , , , , SIGINT: 1. SIGINT, bash , SIGINT SIGINT (, SIGINT, ). 2. SIGINT, SIGINT . bash SIGINT , , SIGINT (, emacs ) . , bash - , SIGINT, - , , . , bash , , SIGINT, . SIGINT, , . , SIGINT, bash , SIGINT ( 1 ), . () () . , bash. . , jobs. , jobs . 1. bash ( ), : [1] 25647 , 1 ID , ' 25647. . Bash . , . ' . , , . (, ) , SIGINT. , . - , ; , . , "stty tostop", , . SIGTTIN (SIGTTOU) (, "tostop" ) , , , , bash, , bash . ( ^Z, Control-Z) bash. ( ^Y, Control-Y) , , bash. , bg, , fg, , kill, . s - - . , ' , SIGSTOP kill. . % (jobspec). n %n. , , , . , %ce , ce. %?ce, , - , ce . , bash . %% %+ . % ( ) . %- . , , . , , . , . , %+ %- . , (, jobs), +, -- -. , : % "fg %1", 1 . , "%1 &" 1 , , "bg %1". , . , bash , , , , . -b set, bash . Bash - SIGCHLD ', . , bash , bash . jobs , wait , , ' . , 1. bash ( , checkjobs shopt), , , checkjobs , . jobs. , , bash , - . wait, , wait , . -f wait, , . , bash PS1, , PS2, . Bash PROMPT_COMMAND . - PROMPT_COMMAND , Bash , , . Bash PS0 , . Bash PS4, , , -x. Bash PS0, PS1, PS2 PS4 , , : \a ASCII (07). \d "Weekday Month Date" (: "Tue May 26"). \D{} strftime(3), ; . \e escape ASCII (033) \h ".". \H . \j , . \l (: "ttys0"). \n . \r . \s , $0 ( ). \t 24- ::. \T 12- ::. \@ 12- /. \A 24- :. \u . \v bash (: 2.00). \V bash, + (: 2.00.0) \w PWD ($PWD) $HOME ( PROMPT_DIRTRIM). \W $PWD $HOME, . \! . \# . \$ (UID) 0, #, $. \nnn , nnn. \\ . \[ , . \] . : - , , (. ), -- , . , , , promptvars (. shopt ). , ' , . READLINE , , --noediting. -e read. emacs. vi. - -o emacs -o vi set (. ). , +o emacs +o vi set. Readline Emacs. Control C-, , C-n Control-N. , Meta M-, , M-x Meta-X. "Alt" "Option". Meta, M-x ESC x, , ESC, x, . ESC Meta-. M-C-x ESC-Control-x, ESC, Control x . - Meta (0200). enable-meta-key, , , . , ESC, . Meta ESC, ' M-key (. ' Readline ), force-meta-prefix. eadline , . , , . ' , (., kill-line) . , . , . . readline : , redisplay readline , active-region-start-color. enable-active-region . ; . , (). . , , . , , . Readline Readline is customized by putting commands in an initialization file (the inputrc file). The name of this file is taken from the value of the INPUTRC shell variable. If that variable is unset, the default is ~/.inputrc. If that file does not exist or cannot be read, readline looks for /etc/inputrc. When a program that uses the readline library starts up, readline reads the initialization file and sets the key bindings and variables found there, before reading any user input. inputrc . . , #, . , $, . ' . ' ' inputrc. , readline, bash, '. , M-Control-u: universal-argument C-Meta-u: universal-argument inputrc , M-C-u readline universal-argument. : DEL, ESC, ESCAPE, LFD, NEWLINE, RET, RETURN, RUBOUT ( ), SPACE, SPC TAB. , readline ' , , (). , . readline , ' inputrc, . , ' . : , Meta- Control-, . . . _:_ , _ . : Control-u: universal-argument Meta-Rubout: backward-kill-word Control-o: "> output" C-u ' universal-argument, M-DEL ' backward-kill-word, C-o ' , ( "> output" ). , "_":_ , _ _ , , , . GNU Emacs, , . "\C-u": universal-argument "\C-x\C-r": re-read-init-file "\e[11~": "Function Key 1" C-u ' universal-argument. C-x C-r ' re-read-init-file, ESC [ 1 1 ~ ' "Function Key 1". , GNU Emacs: \C- Ctrl. \M- - -, force-meta-prefix. \e . \\ . \" ", . \' ', . GNU Emacs, : \a () \b backspace \d Delete \f \n \r \t \v \nnn , nnn ( ). \xHH , HH ( ). . . . - , " '. readline bash bind. -o emacs -o vi set (. ). Readline readline , . inputrc : set _ bind (. ). , readlinereadline On Off ( ). . readline , "on" ( ), "1" On. Off. bind readline (. ). : active-region-start-color , (. enable-active-region ). - , . . . , , terminfo. "\e[01;33m". active-region-end-color , "undoes" active-region-start-color "normal" . , , . . . , , terminfo. : "\e[0m". bell-style (audible) , , readline . none, readline . visible, readline , . audible, . bind-tty-special-chars (On) On, readline ' , , readline. ' readline, . "stty -a" bash, , ( cchars). blink-matching-paren (Off) On, readline , . colored-completion-prefix (Off) On, readline . LS_COLORS. $LS_COLORS ".readline-colored-completion-prefix", readline , . colored-stats (Off) On, readline , , . LS_COLORS. comment-begin ( "#") , , readline insert-comment. ' M-# emacs # vi. completion-display-width (-1) , . , 0 . 0 . -1. completion-ignore-case (Off) On, readline . completion-map-case (Off) On completion-ignore-case, readline (-) (_) . completion-prefix-display-length (0) , . , , , , . , eadline , . completion-query-items (100) , , possible-completions. - , . , readline , ; . , readline ; ' . convert-meta (On) On, readline , ASCII, ( , meta). -- On, readline Off, , . LC_CTYPE , . ' ; . force-meta-prefix . disable-completion (Off) On, readline . , ' self-insert. echo-control-characters (On) On, , , readline , , . editing-mode (emacs) , readline ' , Emacs vi. _ emacs vi. emacs-mode-string (@) show-mode-in-prompt , , emacs. ' , - . \1 \2, , . enable-active-region (On) On, readline . , readline active-region-start-color, , . , , - , . enable-bracketed-paste (On) On, readline , , , , . ; readline - , ' , ' . enable-keypad (Off) On, readline . , . enable-meta-key (On) On, readline - - meta, . Meta ; , , , (0200), Meta (). expand-tilde (Off) On, readline , . force-meta-prefix (Off) On, readline ' , \M- Meta- (. ' ), \M-C Meta-C ESC C ( meta). force-meta-prefix Off ( ), readline convert-meta, , : convert-meta On, readline ; Off, readline C , (0200). history-preserve-point (Off) On, , previous-history next-history. history-size ( ) , . 0, , . , . bash HISTSIZE. history-size , 500. horizontal-scroll-mode (Off) On, readline , , , . 1. input-meta (Off) On, readline ( , ), , . -- Off, readline On, , . LC_CTYPE, , . meta-flag input-meta. isearch-terminators ( "C-[C-j") , . , ESC C-J. keymap (emacs) readline. : emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-command vi-insert. vi vi-command; emacs emacs-standard. emacs; editing-mode . keyseq-timeout (500) readline , (, , ). readline , readline , . , 1000 , readline . , , , readline , , . mark-directories (On) On, . mark-modified-lines (Off) On, , , readline (*). mark-symlinked-directories (Off) On, , , , mark-directories. match-hidden-files (On) On, readline , "." ( ) . Off, "." , . menu-complete-display-prefix (Off) On, ( ) . output-meta (Off) On, readline , escape- . Off, readline On, , . LC_CTYPE . page-completions (On) On, readline more(1) . prefer-visible-bell . bell-style. print-completions-horizontally (Off) On, readline , . revert-all-at-newline (Off) On, accept-line , accept-line. readline. search-ignore-case () On, readline . show-all-if-ambiguous (Off) . On, , , . show-all-if-unmodified (Off) , show-all-if-ambiguous. On, , - ( ), . show-mode-in-prompt (Off) On, , : emacs, vi, vi. (., emacs-mode-string). skip-completed-text (Off) On, . . , readline , , , . vi-cmd-mode-string ((cmd)) show-mode-in-prompt , , vi . ' , - . \1 \2, , . vi-ins-mode-string ((ins)) show-mode-in-prompt , , vi . ' , - . \1 \2, , . visible-stats (Off) On, , , stat(2). readline Readline , C, ' . . $if $if ' , , , , readline. - ; , . mode mode= $if , readline emacs vi. set keymap, , ' emacs-standard emacs-ctlx, readline emacs. term term= ' , , ' . = -. , , xterm xterm, xterm-256color. version version readline. version readline. = ( ==), !=, <=, >=, < >. , , , ' ' (, 7.1). , 0. version . application application . , readline, , . ' , . , , bash: $if Bash # "\C-xq": "\eb\"\ef\"" $endif variable variable readline. =, == !=. ; . , . on off. $else $if , . $endif , , $if. $include This directive takes a single filename as an argument and reads commands and key bindings from that file. For example, the following directive would read /etc/inputrc: $include /etc/inputrc readline (. ) , . : . , . , readline , . . emacs C-r, . C-s . isearch-terminators. ' , ESC C-j. C-g . , . , C-r C-s, . , . - ' readline . , , . , . Readline ' . C-r , '. , . . readline , '. '. , point , mark , set-mark. , region. readline . , readline active-region-start-color. readline enable-active-region . ; . beginning-of-line (C-a) . ' Home. end-of-line (C-e) . ' End. forward-char (C-f) . ' . backward-char (C-b) . ' . forward-word (M-f) . . backward-word (M-b) . . shell-forward-word (M-C-f) . , . shell-backward-word (M-C-b) . , . previous-screen-line . , readline . next-screen-line . , readline readline . clear-display (M-C-l) , , , , . clear-screen (C-l) , , . . redraw-current-line . accept-line (Newline, Return) , , . , HISTCONTROL HISTIGNORE. , . previous-history (C-p) , . ' . next-history (C-n) , . ' . beginning-of-history (M-<) . end-of-history (M->) , , . operate-and-get-next (C-o) , , . , , , . fetch-history . , . reverse-search-history (C-r) , "up" <<>> , . . . forward-search-history (C-s) , "down" <<>> , . . . non-incremental-reverse-search-history (M-p) , , , . - . non-incremental-forward-search-history (M-n) , . - . history-search-backward . . . ' Page Up . history-search-forward . . . ' Page Down . history-substring-search-backward . - . - . history-substring-search-forward . - . - . yank-nth-arg (M-C-y) ( ) . n, n- ( 0). n- . n , n- , "!n" . yank-last-arg (M-., M-_) ( ). , yank-nth-arg. yank-last-arg , ( , ) . - . ( ), , "!$" . shell-expand-line (M-C-e) , . , $'' $"", , , , , . . . HISTORY EXPANSION , . history-expand-line (M-^) . . magic-space . . alias-expand-line . . history-and-alias-expand-line . insert-last-argument (M-., M-_) yank-last-arg. edit-and-execute-command (C-x C-e) . Bash $VISUAL, $EDITOR emacs, . end-of-file ( C-d) , , , , stty(1). , , , readline EOF. delete-char (C-d) . ' , tty EOF, C-d, . . ' Delete . backward-delete-char (Rubout) . , . forward-backward-delete-char , ; . quoted-insert (C-q, C-v) . , , C-q. tab-insert (C-v TAB) . self-insert (a, b, A, 1, !, ...) . bracketed-paste-begin "bracketed paste" , , ' . readline , , . , ' self-insert, - . . transpose-chars (C-t) , . , . ' . transpose-words (M-t) , . , . shell-transpose-words (M-C-t) , . , . , shell-forward-word shell-backward-word. upcase-word (M-u) ( ) . ' , , . downcase-word (M-l) ( ) . ' , , . capitalize-word (M-c) ( ) . ' , , . overwrite-mode . . . emacs; vi . readline() . , ' self-insert, , . , ' backward-delete-char, . ', ' Insert . kill-line (C-k) . ' . backward-kill-line (C-x Rubout) . ' , . unix-line-discard (C-u) . . kill-whole-line ' . kill-word (M-d) , , . , forward-word. backward-kill-word (M-Rubout) . , backward-word. shell-kill-word (M-C-d) , , . , shell-forward-word. shell-backward-kill-word . , shell-backward-word. unix-word-rubout (C-w) , . . unix-filename-rubout , , . . delete-horizontal-space (M-\) . kill-region . copy-region-as-kill , , . copy-backward-word . , backward-word. copy-forward-word . , forward-word. yank (C-y) . yank-pop (M-y) , . yank yank-pop. digit-argument (M-0, M-1, ..., M--) , , . M-- . universal-argument . , , <<>>, . , universal-argument , . , , , <<>>, . , , -- , . complete (TAB) . Bash , - (. ), otherwise, ( $), ( ~), ( @) ( , ) . , . possible-completions (M-?) . readline , , completion-display-width, COLUMNS . insert-completions (M-*) , possible-completions, , . menu-complete complete, . menu-complete , . , menu-complete ( bell-style) . n n ; . ' TAB, '. menu-complete-backward menu-complete, , menu-complete . '. export-completions , , readline, : o N; o , ; o S:E, S E readline; o , , "0", S:E. , , . , , , S:E, . N . . , N , S:E, . ' . delete-char-or-list , ( delete-char). , possible-completions. '. complete-filename (M-/) . possible-filename-completions (C-x /) , . complete-username (M-~) ' . possible-username-completions (C-x ~) , . complete-variable (M-$) . possible-variable-completions (C-x $) , . complete-hostname (M-@) . possible-hostname-completions (C-x @) , . complete-command (M-!) , , . , , , , , , , . possible-command-completions (C-x !) , . dynamic-complete-history (M-TAB) , . dabbrev-expand , . complete-into-braces (M-{) , (. ). start-kbd-macro (C-x () . end-kbd-macro (C-x )) . call-last-kbd-macro (C-x e) , , . print-last-kbd-macro () , , inputrc. re-read-init-file (C-x C-r) inputrc ' , . abort (C-g) ( bell-style). do-lowercase-version (M-A, M-B, M-x, ...) x , , ' . , x . prefix-meta (ESC) . ESC f , Meta-f. undo (C-_, C-x C-u) , . revert-line (M-r) , . undo . tilde-expand (M-&) - . set-mark (C-@, M-<>) . , . exchange-point-and-mark (C-x C-x) . , . character-search (C-]) , . ' . character-search-backward (M-C-]) , . ' . skip-csi-sequence , , , Home End. (CSI), , ESC [. ' "\e[", , , , ' readline, -- . , ', , , ' ESC [. insert-comment (M-#) readline comment-begin. , : comment-begin, , , comment-begin . , . comment-begin . , . spell-correct-word (C-x s) , , , cdspell. , shell-forward-word. glob-complete-word (M-g) . . glob-expand-word (C-x *) . . , * . glob-list-expansions (C-x g) , glob-expand-word . , * . dump-functions ' readline. , , inputrc. dump-variables readline readline. , , inputrc. dump-macros readline, ' , readline. , , inputrc. execute-named-command (M-x) ' readline , ', , , ', . , , . display-shell-version (C-x C-v) bash. , (compspec) complete (. ), readline . , bash . compspec, compspec . ( ), bash - compspec, -E, complete. -I complete , , ; |. . , bash compspec . compspec, bash compspec , . compspec comspec , , bash - compspec, -D complete. compspec , bash , , compspec , - . compspec , bash , . , , compspec , bash . , bash , compspec. , , . -f -d, bash FIGNORE. , -G, . ' , . bash FIGNORE, GLOBIGNORE. , , -W. , IFS, . . , , IFS. , , , , . , . , , . . , , bash - -F -C. , bash COMP_LINE, COMP_POINT, COMP_KEY COMP_TYPE , . , COMP_WORDS COMP_CWORD. , ($1) , , ($2) -- , , ($3) -- , , . ; , . - , -F. , compgen compopt, , . - COMPREPLY, . , - , -C, , . , , . , , . . bash , - , -X. - , ujhnf ; & , . & ; . - , , . ! ; bash - , . nocasematch, bash . , - , -P -S, , , readline . , -o dirnames complete compspec, . compspec complete -o plusdirs, bash , . , compspec, . bash , readline . -o bashdefault complete compspec, comspec , bash . compspec , , bash , -o default complete compspec, readline. , complete compopt, , readline . , -o fullquote readline , , . . complete , . compspec , , readline , readline mark-directories, readline mark-symlinked-directories. . , , complete -D. , , , , 124. 124 compspec, ' , ( , ), compspec . , . , , compspec, , , : _completion_loader() { . "/etc/bash_completion.d/$1.sh".if 0<80n \ >/dev/null 2>&1 && return 124 } complete -D -F _completion_loader.if 0<80n \ -o bashdefault -o default -o history set, , - , . HISTSIZE . HISTSIZE ( - 500). (. ), , HISTIGNORE HISTCONTROL. On startup, bash initializes the history list by reading history entries from the file named by the HISTFILE variable (default ~/.bash_history). That file is referred to as the history file. The history file is truncated, if necessary, to contain no more than the number of history entries specified by the value of the HISTFILESIZE variable. If HISTFILESIZE is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated. , , , . , , HISTTIMEFORMAT. , , . , bash $HISTSIZE $HISTFILE. histappend (. shopt ), bash , . HISTFILE , , . bash HISTFILESIZE , . HISTTIMEFORMAT, , ' , , , . , . , HISTTIMEFORMAT . fc (. SHELL BUILTIN COMMANDS) . history . , , , . , . HISTCONTROL HISTIGNORE . cmdhist, , , , . lithist cmdhist . , . shopt . , csh. . , +H set (. ). , "set -H". , , . , , ' , . , . . -- , . -- . , , , - . . , , , , , , . , ' , . , !. ' - , . (\) , , , . , ' , : , , , , = . , , ( hischar). , , !!, . . , . (. shopt ), histverify readline, . , readline . readline histreedit, readline . -p history , , . -s history , , , . , (. histchars ). . -- . , , , . , . ! , , , , = , extglob shopt (. !n n . !-n n. !! . "!-1". ! , . !?[?] , . ? , . , . , . ^string1^string2^ . , 1 2. "!!:s^string1^string2^" (. ). !# , . . '; , . : . , ^, $, *, - %. . 0 (). . 0 () . . n n- . ^ : 1. $ . , , , . % , "?string?" , , . , , , -- , . x-y ; "-y" "0-y". * , . "1-$". *, ; . x* x-$. x- x-$, x*, . x, 0. - , , !!. ' , ":". , . h , . t , . r .xxx, . e , . p , . q , . x , q, . q x ; . s/// . - /. ', . . &, . &. , , , !?[?]. , . & . g ":s" (: ":gs/old/new/") ":&". ":s", , - /, ', . a g. G "s" "&" . , , , -, -- . :, true, false test/[ -- . exit, logout, return, break, continue, let shift , -, --. , , , , , -, , -- . : [] ; , - . . . [-p ] _ [] source [-p ] _ [] . (source) , . , . . -p, . , , ; . PATH, , . ' . bash posix, , PATH, , -p. sourcepath shopt , . PATH. - , . . -T, . - DEBUG; , - DEBUG ., . DEBUG . -T , DEBUG, .. -- , (0, ), , . alias [-p] [[=] ...] -p alias alias = . , , . , . , , . alias <<>>, ( =), . bg [_ ...] _ , , &. _ , . bg _ 0, , , _, , . bind [-m '_] [-lsvSVX] bind [-m '_] [-q ] [-u ] [-r _] bind [-m '_] -f _ bind [-m '_] -x _[:] _ bind [-m '_] _:_ bind [-m '_] -p|-P [_readline] bind [-m '_] _:_readline bind --readline ' readline, ' , readline readline. , , , readline, .inputrc, ' ' . : '"\C-x\C-r": re-read-init-file'. , , , ' readline bind. , , : -m '_ '_ ' , '. '_ emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command vi-insert. vi vi-command (vi-move ); emacs emacs-standard. -l readline. -p ' readline , bind readline. , bind readline . -P ' readline. , bind readline . -s ' readline , , bind readline. -S ' readline , . -v readline , bind readline. -V readline . -f _ ' _. -q , readline. -u ' , ' readline. -r _ - ' keyseq. -x _[: ]_ , _ -. _ - , ( ), . , - , readline - - . , - ', readline . ' , . - READLINE_LINE readline, READLINE_POINT READLINE_MARK (), . - READLINE_ARGUMENT. , . - READLINE_LINE, READLINE_POINT READLINE_MARK, . -X , ' , ' , bind. 0, . break [n] for, while, until select. n, break n . n >= 1. n , . 0, n 1. builtin -- [] shell-builtin, , . , , , . cd. <<>>, --. caller [] - ( , . source). , caller . , caller , , . , , . 0. 0, . cd [-L] [-@] [] cd -P [-e] [-@] [] . , HOME. CDPATH, dir (/), cd : CDPATH. CDPATH (:). CDPATH , ".". The -P option causes cd to use the physical directory structure by resolving symbolic links while traversing dir and before processing instances of .. in dir (see also the -P option to the set builtin command). The -L option forces cd to follow symbolic links by resolving the link after processing instances of .. in dir. If .. appears in dir, cd processes it by removing the immediately previous pathname component from dir, back to a slash or the beginning of dir, and verifying that the portion of dir it has processed to that point is still a valid directory name after removing the pathname component. If it is not a valid directory name, cd returns a non-zero status. If neither -L nor -P is supplied, cd behaves as if -L had been supplied. -e -P, cd , . , , -@ , ' , . - $OLDPWD . cd CDPATH, - , , cd . , cd PWD , OLDPWD . true, ; false . command [-pVv] [ ...] command , . , PATH . -p, PATH, . -V -v, command . -v , , ; -V . -V -v, , , , . , 127. . compgen [-V _] [] [] - , . - , complete -p, -r, -D, -E -I. . -V, compgen -- _ , . -F -C , , , . , . , , . true, . complete [-abcdefgjksuv] [-o -] [-DEI] [-A ] [-G ] [-W ] [-F ] [-C ] [-X _] [-P ] [-S ] [ ...] complete -pr [-DEI] [ ...] , . -p , , . -r , , . -D , <<>> ( "default" ) ; , , . -E , <<>> ( "empty" ) ; , . -I , , , , ; |, , , . , -D -E, -I. - -D, -E -I, ; , . above under Programmable Completion. , , . -G, -W -X (, , -P -S) , complete. -o - - compspec . - : bashdefault bash, compspec . default readline, compspec . dirnames , compspec . filenames readline, compspec, - , ( , ). . fullquote readline, , . noquote readline, , (, ). nosort readline, . nospace readline, ( ) , . plusdirs , compspec, . . -A : alias . -a. arrayvar -. binding ' readline. builtin . -b. . -c. directory . -d. disabled . enabled . export . -e. , readline. -f. function . group . -g. helptopic , help. hostname , , HOSTFILE. job , . -j. keyword . -k. running , . service . -s. setopt -o set. shopt , shopt. signal . stopped , . user . -u. variable . -v. -C , . , -F. -F . ($1) , , ($2) , , ($3) , , , . - COMPREPLY. -G _ _. -P . -S . -W _ IFS , . _ , , IFS. -, , . -X _ _ -- , . , , , _ . ! _ . , , _. <<>>, , , -p, -r, -D, -E -I, , , , . compopt [-o ] [-DEI] [+o ] [] , , . , . -- , complete, . -D , "default" ; -E , "empty" ; -I , . , complete. , -D -E, -I. <<>>, , , , . continue [n] continue for, while, until select. n, bash n- . n >= 1. n , ( "top-level" ). 0, n 1. declare [-aAfFgiIlnrtux] [-p] [[=] ...] typeset [-aAfFgiIlnrtux] [-p] [[=] ...] / . , . -p . -p , , -f -F, . -p , declare , , . -p , declare . -f . -F ; . extdebug shopt, , . -F -f. -g , declare . , declare . -I , ( nameref) - . , . : -a - (. above). -A - (. above). -f . -i ; (. above) . -l () (). . -n nameref, . . , , , -n, , . nameref -. -r . . -t . DEBUG RETURN , . . -u () (). . -x - . "+" "-" <<+>> <<->>, , , +a +A - +r << >>. , declare typeset , local, -g. =, . -a -A -, , . 0, , "-f foo=bar", , - (. above), , , << >> , - , , -f. dirs [-clpv] [+n] [-n] , '. , . pushd; popd . . , , : -c . -l ; . -p . -v . +n n- , , dirs ; . -n n- , , dirs ; . 0, , n . disown [-ar] [-h] [ ...] . ; , disown , , . -h, disown , , , , SIGHUP , SIGHUP. , -a ; -r . , -a, -r, disown . 0, . echo [-neE] [ ...] , . 0, . -n, . -n, echo. -e, . -E , , . xpg_echo , echo . echo --, . echo : \a () \b backspace \c \e \E \f \n \r \t \v \\ \0nnn , nnn ( ). \xHH , HH ( ). \uHHHH Unicode (ISO/IEC 10646), HHHH ( ). \UHHHHHHHH Unicode (ISO/IEC 10646), HHHHHHHH ( ). echo . enable [-a] [-dnps] [-f _] [ ...] . , , , , , , , . -n, , ; , . , test, , PATH, , "enable -n test". -p, . , . -n, . -a, , , . -s POSIX -f ' , . , bash BASH_LOADABLES_PATH , , . BASH_LOADABLES_PATH "." . -d , -f. -s -f, POSIX , , enable ' , "enable -f name name". 0, ' . eval [ ...] ' , . bash , eval. , eval 0. exec [-cl] [-a ] [ []] , . . . -l, , . , login(1). -c , . -a, . , , execfail. , . , . , exec . , 0. , 1. exit [n] n. n , . - EXIT. export [-fn] [[=]] ... export -p [-f] . -f, . -n , , . -p, export . -p -f . -p , . export =. . export 0, , , -f , . false ; . fc [-e _] [-lnr] [] [] fc -s [=] [] . ( , ) ( , ' ). 0 -1, -0 (, fc). , 0 -1, -0 . , (, "fc -l -10" 10 ) . , , -16 . -l, . -n . -r . Otherwise, fc invokes the editor named by ename on a file containing those commands. If ename is not supplied, fc uses the value of the FCEDIT variable, and the value of EDITOR if FCEDIT is not set. If neither variable is set, fc uses vi. When editing is complete, fc reads the file containing the edited commands and echoes and executes them. fc . , . fc "r=fc"-s(dq" , "r cc" , "cc" "r" . , , . , . , , . fc . fg [_] _ . _ , . , , , , , , _ _ . . getopts _ [ ...] getopts . _ , ; , , . . getopts , , , , , OPTIND. OPTIND 1 , . , getopts OPTARG. OPTIND; getopts , . , getopts , . OPTIND ?. , getopts , , , getopts . getopts . _ , getopts . getopts , . OPTERR 0, getopts , _ . getopts , ? , , OPTARG. getopts , OPTARG, . ' getopts , (?) , OPTARG . getopts , (:) , OPTARG . getopts <<>>, , . <<>>, . hash [-lr] [-p _] [-dt] [] , hash, ' , $PATH. - , ' , . -p, hash . -r . PATH . -d . -t, hash , . -t , hash . -l , . -l, hash . -t, -d -p (, ) . . , -t , -p, , -d. , . help [-dms] [] . , help , , . , . , , : -d -m , -s (. ), , help , . , , help , ' . help . 0, , . history [n] history -c history -d history -d - history -anrw [_] history -p [ ...] history -s [ ...] , . * . n n . HISTTIMEFORMAT , strftime(3), , ' . history HISTTIMEFORMAT, . , history ; , HISTFILE. , HISTFILE , -a, -n, -r, -w . , , : -c . . -d . ', , . , ' , -1 history -d. -d - , . ' . -a "new" . , bash, . -n , , . , bash. -r . -w , . -p . . -s . . HISTTIMEFORMAT, , ' history , , . , , , , , . 0, , , -d, , -p. jobs [-lnprs] [ _ ... ] jobs -x [ ... ] . : -l . -n , , . -p , . -r , . -s . _, jobs . 0, _. -x, jobs - jobspec, command args , command args, . kill [-s _ | -n _ | -_] [ ... ] kill -l|-L [sigspec | exit_status] , _ , , . . _ -- , SIGKILL ( SIG ), ; -- . , kill SIGTERM. -l . -l - , kill , , 0. _ -l - , , , ; , kill , . kill , 128; , , . -L -l. kill true, , false, . let arg [arg ...] , (. above). arg 0, let 1; 0. local [option] [[=value] ... | - ] . - , declare. local , . local . -, , local: - , set local, . , set , , . local . 0, local , , . logout [n] , n . mapfile [-d ] [-n ] [-O ] [-s ] [-t] [-u _] [-C _] [-c ] [] readarray [-d ] [-n ] [-O ] [-s ] [-t] [-u _] [-C _] [-c ] [] -- , _, -u. MAPFILE. , , : -d . , mapfile , NUL. -n . 0, . -O . 0. -s count . -t ( ) . -u _, . -C _ , . -c. -c , _. -C -c, 5000. callback , , , , , , . callback , . , mapfile . mapfile , , , , . popd [-n] [+n] [-n] . 0 dirs, popd "popd +0." . , , : -n , , . +n n- , , dirs; . : "popd +0" , "popd +1" . -n n- , , dirs; . : "popd -0" , "popd -1" . , B, popd cd . cd , popd . popd <<>>, , , . popd , bash dirs, , 0. printf [-v ] [] . -v var . , ': , , , , , . printf(3) cCsSndiouxXeEfFgGaA, printf : %b printf , echo -e. %q printf , . %q %Q $'', - , . printf, . %Q %q, - . %(_)T printf -, datefmt, strftime(3). argument , . : -1 , -2 , . , , -1. printf. %b, %q %T ( ) , , . %n , . %s %c l (long), - , . %S %C %ls %lc . C, , , , . . , , , , . , , . pushd [-n] [+n] [-n] pushd [-n] [] , . , pushd . , , : -n , , . +n , n- ( , dirs ) . -n , n- ( , dirs ) . . , -n, pushd cd . cd , pushd . , , pushd 0, . pushd 0, n , . pushd , bash dirs, . pwd [-LP] . -P -o set, . -L, . 0, . read [-Eers] [-a ] [-d ] [-i ] [-n _] [-N _] [-p ] [-t _] [-u _] [ ...] _, -u, , above , , -- . , . , , . IFS. , ( above ). (\). , , : -a _ - aname, 0. aname . . -d . , read , NUL. -e , read readline (. READLINE above) readline ( , ) , Readline. -E , read readline (. READLINE above) . Readline ( , ) , bash, . -i readline , read . -n -_ read _ , , read, , _ . -N -_ read _ , , EOF read . -, , read, _ . IFS; , ( ; . -r). -p , , - , . -r . , . , << -- >> . -s . , . -t _ read , ( ) _ . . , read , -- . read - , , 128. _ 0, read , . 0, EOF. , . -u _ _, . , , read NUL . , , , , REPLY. , , read ( 128), (, , ) -u. readonly [-aAf] [-p] [[=] ...] , ; . -f, . -a , -A -- . , -A. , -p, . . -p , . readonly << >>, =. << >>. 0, , , -f , . return [n] , n, , . n , . return , , , , . return DEBUG, , , , return. return , . (source), n, , , . n, 8 . - , ' RETURN, , . , return , . source. set [-abefhkmnptuvxBCEHPT] [-o -] [--] [-] [ ...] set [+abefhkmnptuvxBCEHPT] [+o -] [--] [-] [ ...] set -o set +o , , . , , . posix . . , . , , . , , $1, $2, ..., $n. , , : -a , , . -b , . , . -e , ( ), (. above), . , , , while until, if elif, - , && ||, && ||, - , ( pipefail), !. , , , -e, . ERR, . (. above), , , . , -e, , , -e, -e . -e , -e , , . -f . -h ' , . . -k , , , . -m . . , , (. above). . . -n , . . . -o _ option-name : allexport , -a. braceexpand , -B. emacs emacs. , --noediting. , read -e. errexit , -e. errtrace , -E. functrace , -T. hashall , -h. histexpand , -H. history , above . . ignoreeof , "IGNOREEOF=10" (. Shell Variables above). keyword , -k. monitor , -m. noclobber , -C. noexec , -n. noglob , -f. nolog . notify , -b. nounset , -u. onecmd , -t. physical , -P. pipefail , , , ( ) , . . posix posix; bash , POSIX , POSIX below , , posix bash. privileged , -p. verbose , -v. vi vi. , read -e. xtrace , -x. -o _, set . +o _, set set . -p . $ENV $BASH_ENV, , SHELLOPTS, BASHOPTS, CDPATH GLOBIGNORE, , . (), () -p, , . -p, . , . -r . , . -t . -u , "@" "*", - "@" "*", . , , , . -v . -x , for, case, select for PS4, ' . -B (. Brace Expansion above). . -C , bash , >, >& <>. >| > . -E , - ERR , , . , , ERR . -H !. , . -P , ' , cd, . . , bash, , , . -T , - DEBUG RETURN , , . , , DEBUG RETURN . -- , . , , -. - . -x -v . , . , . + - . . $-. , . shift [n] n+1 ... $1 .... , $# $#-n+1 . n ' , $#. n 0, . n , 1. n $#, . n $# , ; - 0. shopt [-pqsu] [-o] [_ ...] , ' . , , -o, -o set. -p, , , , ; - , . -p , . : -s () optname. -u () optname. -q ( ); , optname. optname -q, optnames, , ; - . -o _ , -o set. -s -u optname, shopt , . , shopt ( ). , optnames , - . , , optname . shopt: array_expand_once , , , , , . assoc_expand_once ; array_expand_once. autocd , , , , cd. . bash_source_fullpath , , - BASH_SOURCE, (. ). cdable_vars , cd, , , , . cdspell , cd cd . , . cd , . . checkhash , bash , , -, . , bash . checkjobs , bash, , - . , bash (. above). , . checkwinsize , bash ( ) , , LINES COLUMNS , ' , . . cmdhist , bash . . , , , above . compat31 compat32 compat40 compat41 compat42 compat43 compat44 (. SHELL COMPATIBILITY MODE below). complete_fullquote , bash . , bash , , , , ' , . , , , ; - , ' , . , bash . , bash 4.2. direxpand , bash, , . readline. , bash , . dirspell , bash , . dotglob , bash , "." in the results of pathname expansion. The filenames . and .. must always be matched explicitly, even if dotglob is set. execfail , , , exec. exec. expand_aliases , , above . . extdebug , , --debugger. , : 1. -F declare , . 2. DEBUG , . 3. , DEBUG, 2, ( , . source), return. 4. BASH_ARGC BASH_ARGV , above). 5. : , , ( ) DEBUG RETURN. 6. : , , ( ) ERR. extglob , , above . extquote , $'' and $"" ${}, . . failglob , , , . force_fignore , , FIGNORE, , . . above , FIGNORE. . globasciiranges , , (. above) C. , b A B, ASCII . globskipdots If set, pathname expansion will never match the filenames . and .., even if the pattern begins with a ".". . globstar , **, , . /, . gnu_errfmt , GNU. histappend , , , , HISTFILE, . histreedit , readline, e . histverify , readline, . readline, . hostcomplete , readline, bash , , @ (. READLINE above). . huponexit , bash SIGHUP. inherit_errexit , errexit, . , posix. interactive_comments , #, , (. above). . lastpipe , , . lithist , cmdhist , , , . localvar_inherit , , , . nameref . localvar_unset , unset , . . login_shell , (. above). . mailwarn , , bash , , bash "The mail in mailfile has been read". no_empty_cmd_completion , readline, bash PATH, . nocaseglob , bash (. above). nocasematch , bash - case [[, . noexpand_translation , bash $"..." . , . nullglob , , (. above) , , . patsub_replacement , bash & - , , above. . progcomp , (. above). . progcomp_alias , , bash , , . , bash , . promptvars , , , , above. . restricted_shell , (. below). . , , . shift_verbose , shift , . sourcepath , . (source) PATH , , , -p. , . varredir_close , , {-} (. above) . xpg_echo , echo . posix, echo . suspend [-f] , SIGCONT. ; -f. 0, -f. test [ ] 0 () 1 (), . . , above . test , -- . . . . . . ' , test . ! , . ( ) . . -a 2 , , 1 2, true. 1 -o 2 , 1 2 true. test [ . 0 . 1 , . 2 !, , . above , , <<>>. , . 3 , . , above , , . -a -o , . !, , . (, -- ), . <<>>. 4 , , . !, , . (, -- ), . , . 5 . POSIX, [[, < > . POSIX, test [ , ASCII. 4 , , . POSIX -a -o , . . -a -o && || . times , . 0. trap [-lpP] [[] _ ...] - , , - . ( ) -, , . - , , , , . , trap , ' , trap, . -p, , trap , ' , , , , trap, . -P , , ' . -P . -P -p (, ) , , trap , '. -l . -- , , . , SIG '. -l , . _ EXIT (0), . _ DEBUG, , for, case, select, ((, [[, for , (. above). extdebug shopt, above) DEBUG. _ RETURN, , , . source. _ ERR, , ( ), , . ERR , , while until, if, , && ||, && ||, - , ( pipefail), !. , errexit (-e). , , , . . , , , . false, - sigspec ; trap true. true , 0. type [-aftpP] [ ...] , , . -t, type alias, keyword, function, builtin file, name , , , . , type . -p, type , $PATH , , "type -t name" . -P PATH , "type -t name" . , -p -P , ' , ' PATH. -a, type , . , , , , , (-p -P), . type -a -p PATH . -f , command. type true, , false, . ulimit [-HS] -a ulimit [-HS] [-bcdefiklmnpqrstuvxPRT []] , , , , , . -H -S , ' . , root; ' . -H, -S, ', . , , hard, soft unlimited, , ' . , ulimit ' , -H. , , , . : -a ; - . -b . -c . -d . -e ( "nice"). -f , . -i . -k k-, '. -l , '. -m ( ). -n ( ). -p 512- ( ). -q POSIX -r . -s . -t . -u , . -v ' ', , , , . -x . -P . -R , , . -T . -a, . , -f. 1024 , -t, ; -R, ; -p, 512 ; -P, -T, -b, -k, -n -u, ; posix -c -f, 512 . 0, . umask [-p] [-S] [] . , ; , , , chmod(1). , umask . -S . . -p , , . , . . unalias [-a] [ ...] . -a, . <<>>, . unset [-fv] [-n] [name ...] . -v, , . -f, , . -n nameref, , , . -n , -f. . , , . , . , , . . BASH_ALIASES, BASH_ARGV0, BASH_CMDS, BASH_COMMAND, BASH_SUBSHELL, BASHPID, COMP_WORDBREAKS, DIRSTACK, EPOCHREALTIME, EPOCHSECONDS, FUNCNAME, GROUPS, HISTCMD, LINENO, RANDOM, SECONDS SRANDOM, , . <<>>, . wait [-fn] [-p _] [ ...] . ; , wait . , wait , , $!, . -n, wait - , , - . , , , 127. -p, wait , , _, . , , - . -n. -f , wait , . , 127. wait , - , 128, SIGNALS. above. . bash-4.0 , shopt: compat31, compat32, compat40, compat41 . -- . , , . . , (, compat32 , , bash-3.2 ). , , compat32, , , , . , , bash, . , [[ bash-4.1, ASCII, compat32 ASCII. , . , . bash-4.3 : BASH_COMPAT. , ( , 4.2, , compatNN, 42), . bash-4.4, bash . , BASH_COMPAT. Bash-5.0 , shopt . BASH_COMPAT -- , bash-5.0. , . compat NN NN, . bash-5.0 shopt compatNN. bash-4.3 BASH_COMPAT, bash-5.1 . compat31 o [[ (=~) . compat32 o < > [[ ; ASCII. compat40 o < > [[ ; ASCII. Bash bash-4.1 ASCII strcmp(3); bash-4.1 strcoll(3). compat41 o posix time , ( POSIX 267). o posix , , -: ( POSIX 221). compat42 o - , bash-4.2. o posix : ( POSIX 221); compat43 o , , posix ( , , ). o (while/until/) , break continue . Bash-4.4 , . compat44 o , BASH_ARGV BASH_ARGC, , . o , break continue . Bash-5.0 , o , , export readonly, , , , posix. compat50 o bash-5.1 $RANDOM, . 50 , bash-5.0 , RANDOM , bash-5,0. o - , bash bash-5.1 , , . Bash-5.1 , -l. compat51 o unset @ * -, , , . o ( ((...)) ) for . o , [[, . o . o $((...)) . o , , . o test -v, A[@], A -- , true, - . Bash-5.2 @. o ${[:]=} - , (, ). Bash-5.2 , . o , (. shopt ), , extglob (, ), . , extglob . , extglob . compat52 o test , ' . o -p -P -P, bind - , , , ', - , ' , , '. bash rbash, -r, . , , . bash, , : o cd. o SHELL, PATH, HISTFILE, ENV BASH_ENV. o , /. o , /, .. o -p command . o , , history. o , , -p hash. o . o BASHOPTS SHELLOPTS . o >, >|, <>, >&, &>, >>. o exec . o -f -d enable. o enable . o -p command. o set +r set +o restricted. . When a command that is found to be a shell script is executed (see COMMAND EXECUTION above), rbash . . Bash Reference Manual, Brian Fox Chet Ramey The Gnu Readline Library, Brian Fox Chet Ramey The Gnu History Library, Brian Fox Chet Ramey Portable Operating System Interface (POSIX) Part 2: Shell and Utilities, IEEE -- http://pubs.opengroup.org/onlinepubs/9799919799/ http://tiswww.case.edu/~chet/bash/POSIX -- -- posix sh(1), ksh(1), csh(1) emacs(1), vi(1) readline(3) /bin/bash bash /etc/profile , ~/.bash_profile , ~/.bashrc ~/.bash_logout , ~/.bash_history HISTFILE, , bash ~/.inputrc readline Brian Fox, Free Software Foundation bfox@gnu.org Chet Ramey, chet.ramey@case.edu bash, . , , , bash. ftp://ftp.gnu.org/pub/gnu/bash/ http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz. , bashbug . , , , ! "philosophical" bug-bash@gnu.org Usenet gnu.bash.bug. : bash , "recipe" bashbug , . chet.ramey@case.edu. . bash sh , ', , POSIX . . "a ; b ; c" . , - . , , , . - () . Andrij Mizyk , Andriy Rysin , Yuri Chornoivan lxlalexlxl ; , GNU General Public License Version 3 . . , , : . GNU Bash 5.3 7 2025 BASH(1)