Shell – Globbing vs wildcards

linuxshellterminologywildcards

What is the difference between globbing and wildcards, are they two terms for the same thing, or are they different?

Best Answer

Glob is an alternate name for "Pathname Expansion" as described in the dash (sh) or bash manual (ksh calls it "Filename Expansion"). It is clearly defined in the manuals.

After word splitting, unless the -f option has been set, bash scans each word for the characters *, ?, and [. If one of these characters appears, then the word is regarded as a pattern, and replaced with an alphabetically sorted list of filenames matching the pattern

Wildcard is a term for the same concept (one character is used as a pattern standing for several posible characters) but it is not so clearly defined. Wildcard characters are * and ? used in globbing.

An asterisk (``*'') matches any string of characters. A question mark matches any single character.

Related Question