Expand a glob to matching files.

Section: Globbing and Brace Expansion

Match files with glob

bash
bash
printf '%s
' *.txt
Explanation

Globs are expanded by the shell before command execution.

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
Include dotfiles in globs
Make globs match dotfiles too.
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.