Forrest logo
back to the shopt tool

shopt:tldr:beae9

shopt: Print a list of all options and their status formatted as runnable `shopt` commands.
$ shopt -p
try on your machine

The command shopt -p is used to display the current settings of shell options.

When used without any arguments, the shopt -p command will display the status of all the available shell options along with their current values in a format that can be directly executed to set the same options.

For example, if you run shopt -p and one of the options displayed is "nocaseglob", it means the nocaseglob option is currently enabled in the shell. To disable it, you can execute the output of shopt -p that contains "nocaseglob" with the "unset" command, like this: unset nocaseglob.

In summary, shopt -p is a command used to show the current settings of shell options, which can be useful for checking or modifying the behavior of your shell.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the shopt tool