Bash Variables, Quoting, and Expansion/Include dotfiles in globs

Make globs match dotfiles too.

Section: Globbing and Brace Expansion

Include dotfiles in globs

bash
bash
shopt -s dotglob
Explanation

Useful for file moves and maintenance tasks.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Globbing and Brace Expansion
Enable nullglob
Expand unmatched globs to nothing.
OpenIn sheetbashsame section
Match files with glob
Expand a glob to matching files.
OpenIn sheetbashsame section
Brace expansion
Generate multiple words from a brace expression.
OpenIn sheetbashsame section
Sequence expansion
Generate a numeric sequence.
OpenIn sheetbashsame section
Assign variable
Assign a shell variable.
Literal single-quoted string
Single quotes prevent all expansion.