patternto a UNIX shell, and it replaces
patternwith the names of all files that match
pattern. Some simple examples of
ls -l get_buf.?
Another commonly used term for this is called wildcard expansion.
zsh offers very powerful and expressive filename generation - it goes
far beyond what all other UNIX shells can do. To disable filename
generation, turn off the
GLOB option. (
* ( | < [ ?
EXTENDED_GLOB option is set, zsh will also recognize
If one or more files match the pattern, zsh replaces that word with a sorted list of the matching filenames. If no match is found, you can configure zsh's behavior:
|Zsh will:||If you:|
|Display an error message||do nothing (default behavior)|
|Delete the word from the command line||set the |
|Leave the word unchanged||set the |
**/, and it will search all directories recursively. Use
***/if you want zsh to follow symlinks.
For example, to find all .c, .h, and .o files in a directory and all of its subdirectories, enter something like:
lyric > print -l /usr/local/src/**/*.[cho] ... /usr/local/src/fvwm-2.2/modules/FvwmWinList/Mallocs.c /usr/local/src/fvwm-2.2/modules/FvwmWinList/Mallocs.h /usr/local/src/fvwm-2.2/utils/xpmroot.c /usr/local/src/mutt-0.95.4/_regex.h /usr/local/src/mutt-0.95.4/acconfig.h ...
More about wildcard patterns on the next page.
/must be matched explicitly.
.must be matched explicitly at the start of a pattern or immediately after a
pattern. (Or after a
..will never show up in any wildcard match.
Note that rule 2 does not apply if the option
GLOB_DOTS is set.