## Wildcarding in UNIX

Wildcarding allows you to specify groups of files. You can use wildcards as an argument to ls, cp, mv, and rm, as well as to UNIX filters.

WildcardWhat it Represents
?any character
*any glob of zero or more characters
[crmf]any of c, m, r or f. You can put any list of caracters in the brackets to create a wildcard.
[a-z]any charcter falling asciicograpically from a to z. You can put any range of characters you wish in here and you can have more than one range.

Here are some useful examples and what they do.

• ls *.html  List all HTML files in your cwd
• ls */index.html List any file namead index.html in any immediate subdirectory of your cwd
• grep -l cos *.c List all .c files that contain the string "cos" in your current working directory.
• cat *f* |grep -i washington  Put all lines from files containing the letter f in your cwd that contain the word "washington" case-insensitive to stdout