Unix Wildcards |
||||||||||||||||||||||||||||||
|
Wildcard Characters: * and ? |
Wildcards are also known as metacharacters, or characters that have special meaning to the shell. Wildcards like ? or * serve as shortcuts that allow users to abbreviate filenames when they have a list of similarly named files or they have forgotten a complete filename. The question mark matches only single characters in a filename, while the asterisk matches any number of characters, including zero characters. For example, examine the outcome of the following ls commands:
The ? matched only those files with a single character after gdead. The * matched files with any number of characters after gdead, but not those files that did not start with the letters gdead. Wildcards can be used with other commands, notably rm (remove file). To use this command, type rm and the filename. ** Note: Using the asterisk with rm can be very dangerous. You could potentially erase all files. Before using rm *, always ls * to know exactly what you are going to get rid of! |
| For more information on UNIX one can look at: |
|---|
|