Using glob pattern matching

The default glob pattern matching enables you to specify a string using wild card characters. For example, with glob pattern matching, the command can contain a question mark (?) to represent any single character, an asterisk (*) to represent any string, including an empty string, or an expression enclosed by brackets ([. . .]).

You can also use an exclamation point (!) at the start of a command to disallow a matching string. For example, you can prevent users from specifying the program to use for viewing man pages (man –P) by specifying the following commands:

!man –P*
!man * -P*
man

The commands that start with the exclamation point take precedence over the ones that don’t. For example, if you type “!ls –l” and “ls *” as command strings, users will be prevented from running the “ls” command with the “-l” option, even though “ls *” specifies that all options are allowed. If a command is followed by empty quotation marks (""), the command can only run without any options.

For more information about using glob for pattern matching, see the glob and glob(7) man pages.