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


2 Answers 2


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.


Globbing is a practice of using wildcard characters like '*', '?', and '$', to trigger pathname expansion. Also, have a look at the Linux man page for globbing.

It is usually safe to assume that the shell environment you're working with supports globbing. Unless you're using FTP, or old style DOS, or some kind of shell that doesn't support pathname or Filename expansion. However, those wildcard characters ('[' is a wildcard in Linux) may have different meanings or operations in different contexts.

  • 2
    What is $ in pathname expansion ?
    – user232326
    Dec 28, 2017 at 4:36
  • DOS's shell, or CMD shell doesn't have to support globbing. The commands support them e.g. DIR *.*
    – barlop
    May 6, 2020 at 4:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .