Appendix A

Quick Guide to bash Commands

In This Appendix

  • The bash built-in commands
  • The GNU additional shell commands
  • The bash environment variables

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.

Built-in Commands

The bash shell includes many popular commands built into the shell. This provides for faster processing times when using these commands. Table A.1 shows the built-in commands available directly from the bash shell.

Table A.1 bash Built-in Commands

Command Description
alias Define an alias for the specified command.
bg Resume a job in background mode.
bind Bind a keyboard sequence to a readline function or macro.
break Exit from a for, while, select, or until loop.
builtin Execute the specified shell built-in command.
cd Change the current directory to the specified directory.
caller Return the context of any active subroutine call.
command Execute the specified command without the normal shell lookup.
compgen Generate possible completion matches for the specified word.
complete Display how the specified words would be completed.
continue Resume the next iteration of a for, while, select, or until loop.
declare Declare a variable or variable type.
dirs Display a list of currently remembered directories.
disown Remove ...

Get Linux® Command Line and Shell Scripting Bible, Second 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.