Session and utilities
The set command
With no arguments, shows every shell variable. It also changes shell behaviour options.
Syntax
set | set -e | set -xMost useful options
-eAborts the script on the first error-xShows each command before running it (debug)-uErrors on undefined variablesCopy-ready examples
$ setSee the shell variablesYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- set -e in a script is powerful but can abort on errors you did not expect.
FAQ
Which option is essential in scripts?
Many use set -euo pipefail to fail fast on any problem.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course