whatis glob
Glob (Wildcard)
Also known as: wildcard, globbing, pattern matching
Shell patterns like *, ?, and [abc] that expand into matching file names before a command runs.
What Is a Glob (Wildcard) in Linux?
* matches any string, ? matches one character, and [0-9] matches a set. The shell expands them, so rm *.tmp actually runs rm a.tmp b.tmp and the program never sees the asterisk.
Globs are not regular expressions. In a glob * means "anything", while in a regex * means "zero or more of the previous item". Quote a pattern ('*.log') when you want a tool like find to receive it untouched.
Example
ls /etc/*.conf
find . -name '*.log' Learn more about Glob (Wildcard)
- Wildcards vs Regular Expressions Explained Shell wildcards and regular expressions look similar and are constantly confused, but they are different systems used in different places. This guide explains shell globbing patterns, regex basics, and which one applies where.
- Bash Quoting Explained: The Single Biggest Source of Shell Bugs Word splitting and glob expansion on unquoted variables cause more shell breakage than any other single mistake. Here is exactly what each quoting style does and when to use it.
- find Command Explained find searches the live filesystem with powerful filtering by name, size, date, type, and permissions. This guide covers the essential find patterns, including running commands on results with -exec.
Related tools
- find Builder Compose find commands with type, name, time, and size filters, plus prune lists and safe actions.