Bash: shopt
12 December 2025 (Updated 14 December 2025)
What is shopt?
In Bash, shopt stands for “Shell options” and is a command you use to switch specific Bash options on or off.
Enable Bash option with shopt
Syntax
shopt -s <option-name>
The -s stands for “set”.
Example
shopt -s nullglob
Disable Bash option with shopt
Syntax
shopt -u <option-name>
The -u stands for “unset”.
Example
shopt -u <option-name>
View all options
shopt
View specific option
shopt <option-name>
Tagged:
Bash