Bash built-in commands

Updated 14 October 2025

Shell Builtins

Built-in commands are distinct in that they do not require the execution of a child process. They were compiled into the shell and thus become part of its toolkit. There is no external program file to run them.

Bash Built‐In Commands #-B

CommandDescription
. same as source builtin. Reads and executes commands from a designated file in the current shell
&Starts a job in background mode
((x))Evaluates the x mathematical expression
not:Reads and executes commands from a designated file in the current shell.
:Does nothing, and always exits successfully, same as true builtin
[ t ]Evaluates the t conditional expression
[[ e ]]Evaluates the e conditional expression
aliasDefines an alias for the specified command
bgResumes a job in background mode
bindBinds a keyboard sequence to a readline function or macro
breakExits from a for , while , select , or until loop
builtinExecutes the specified shell built‐in command

Bash Built‐In Commands E-F

echoDisplays the specified string to STDOUT
enableEnables or disables the specified built‐in shell command
evalConcatenates the specified arguments into a single command, and executes the command
execReplaces the shell process with the specified command
exitForces the shell to exit with the specified exit status
exportSets the specified variables to be available for child shell processes
falseSets a result to failed status
fcSelects a list of commands from the history list
fgResumes a job in foreground mode
forExecutes set commands for every item in the list
functionDefines a shell script function

Bash Built‐In Commands G-P

getoptsParses the specified positional parameters
hashFinds and remembers the full pathname of the specified command
helpDisplays a help file
historyDisplays the command history
ifExecutes set commands based on conditional expression
jobsLists the active jobs
killSends a system signal to the specified process ID (PID)
letEvaluates each argument in a mathematical expression
localCreates a limited‐scope variable in a function
logoutExits a login shell
mapfileReads STDIN lines and puts them into an indexed array
popdRemoves entries from the directory stack
printfDisplays text using formatted strings
pushdAdds a directory to the directory stack
pwdDisplays the pathname of the current working directory

Bash Built‐In Commands C-D

callerReturns the context of any active subroutine call
caseSelectively executes commands based on pattern
cdChanges the current directory to the specified directory
commandExecutes the specified command without the normal shell lookup
compgenGenerates possible completion matches for the specified word
completeDisplays how the specified words would be completed
compoptChanges options for how the specified words would be completed
continueResumes the next iteration of a for , while , select , or until loop
coprocExecutes a coprocess
declareDeclares a variable or variable type
dirsDisplays a list of currently remembered directories
disownRemoves the specified jobs from the jobs table for the process

Bash Built‐In Commands R-#

readReads one line of data from STDIN , and assigns it to a variable
readarrayReads STDIN lines, and puts them into an indexed array
readonlyReads one line of data from STDIN , and assigns it to a variable that can't be changed
returnForces a function to exit with a value that can be retrieved by the calling script
selectDisplays list of words with numbers allowing selection
setSets and displays environment variable values and shell attributes
shiftRotates positional parameters down one position
shoptToggles the values of variables controlling optional shell behavior
sourceReads and executes commands from a designated file in the current shell
suspendSuspends the execution of the shell until a SIGCONT signal is received
testReturns an exit status of 0 or 1 based on the specified condition
timeDisplays the accumulated real, user, and system times executing command(s)
timesDisplays the accumulated user and system shell times
trapExecutes the specified command if the specified system signal is received
trueSets a result to successful status
typeDisplays how the specified word would be interpreted if used as a command
typesetDeclares a variable or variable type
ulimitSets a limit on the specified resource for system users
umaskSets default permissions for newly created files and directories
unaliasRemoves the specified alias
unsetRemoves the specified environment variable or shell attribute
untilExecutes set commands until condition statement returns true
waitWaits for the specified process to complete, and returns the exit status
whileExecutes set commands while condition statement returns true
{ c; }Group commands to execute within current shell
Spotted a mistake or want something added? Send me a note.