Glob

A Glob is a pattern used by shells to match filenames, for example  to match all JPEG files.

The main glob metacharacters are,  (match zero or more characters) and   (match one character). One can also use groups,  to match one of the given characters (for example   to match all files ending in   or  ).

Globs have to match the entire file name, one can not use  to match   (as one would in a grep regex), and dotfiles are typically not included even though they match. For example,  will match , but not   (since this file won't show up on ls (unless   is used), and because it's a configuration file which probably should not be deleted, especially accidentally).

Examples: scp PIC????.jpg login.host.com:public_html
 * 1) upload PIC0001.jpg, PIC0002.jpg, etc to a host

rm *.rm *.ra
 * 1) delete all realmedia-files

ls /usr/bin/[kx]*
 * 1) list KDE and X applications (amongst other things) in /usr/bin

Notes:
 * When a glob matches nothing, the default in Bash is to not expand it. The bash option 'nullglob' can be set to instead expand it to the empty set. Since most applications perform entirely different functions when invoked without arguments, this is of limited use. (with no .o-files (object files),  would list the current directory instead of nothing,   would give usage information, and   would start reading stdin).
 * Newer shells usually support extended glob capabilities. Bash, if extglob is enabled, allows constructs like  to delete all files except   and  . Zsh supports recursive globs, where   matches all   files in this directory and all its subdirectories. These types of globs are not likely to work on other shells.
 * To match dot-files in Bash, enable the dotglob option.