9 Shell Options

In this category you’ll find various Bash builtin options (shopts) that alter how Bash behaves in different cases.

Bash 3.x

Setting: histappend

When saving the Bash history to $HISTFILE upon Bash exit, the new history entries will be appended to the existing file rather than overwriting it.

Setting: cdspell

This corrects minor errors in the spelling of a directory component in a cd command. The errors checked for are transposed characters, a missing character, and one character too many.

Setting: cdable vars

An argument to the cd builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to.

Setting: checkhash

Lets Bash check that a command found in the hash table exists before trying to execute it. If a hashed command no longer exists, a normal path search is performed.

Setting: cmdhist

When saving History entries try to store multi-line commands in one line.

Setting: force fignore

Ignore all files from completion whichs suffixes are defined in $FIGNORE environment variable. This is enabled by default.

Setting: histreedit

The user is given the opportunity to re-edit a failed history substitution.

Setting: no empty cmd completion

When attempting completion on and empty command line, no completion based on the $PATH variable is done.

Setting: dotglob

When attempting file- or pathname completion include hidden matches (with leading dot).

Setting: extglob

Enable extended pattern matching features.

Setting: nocaseglob

When set file- or pathname expansion is done case insensitive.

Setting: nocasematch

When set pattern matching in case or [[ conditional commands is done case insensitive.

Bash 4.x

Setting: autocd

When the given command is the name of a directory cd into it, instead of executing a command of the same name.

Setting: dirspell

When set bash tries to correct minor spelling mistakes on directory names. For example cd /hoem/ will successfully result in cd /home/.

Setting: globstar

When set the ** glob will match all files, directories and subdirectories, the **/ glob will match all directories and subdirectories, but no files.

Setting: checkjobs

Before exiting bash show the status of currently running background jobs. If there are any, the exit is delayed until a second attempt to prevent accidentally killing running jobs.

Bash 4.3

Setting: direxpand

When set bash tries to expand pathnames from variables upon [TAB].

Setting: glob ascii ranges

When set range expressions for patterng matching behave like in the C locale.