APPENDIX AQuick Guide to Bash Commands
As you've seen throughout this book, the Bash shell contains lots of features and thus has lots of commands available. This appendix provides a concise guide to allow you to quickly look up a feature or command that you can use from the Bash command line or from a Bash shell script.
Reviewing Built‐In Commands
The Bash shell includes many popular commands built into the shell. You can use these commands to achieve faster processing times. Table A.1 shows the built‐in commands available directly from the Bash shell.
TABLE A.1 Bash Built‐In Commands
Command | Description |
---|---|
&
|
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 |
[
t
]
|
Evaluates the t conditional expression |
[[
e
]]
|
Evaluates the e conditional expression |
alias
|
Defines an alias for the specified command |
bg
|
Resumes a job in background mode |
bind
|
Binds a keyboard sequence to a readline function or macro |
break
|
Exits from a
for
,
while
,
select
, or
until
loop |
builtin
|
Executes the specified shell built‐in command |
caller
|
Returns the context of any active subroutine call |
case
|
Selectively executes commands based on pattern |
cd
|
Changes the current directory to the ... |
Get Linux Command Line and Shell Scripting Bible, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.