Skip to content

Glossary: Linux for Developers

if statement

Also written: if, then, else, fi, [ ] test

A shell decision: `if COMMAND; then ... else ... fi`. `[ ... ]` is a command that tests files, text or numbers and answers with its exit code.

Where the book teaches it

Related terms

exit code