O'Reilly logo

Linux® For Dummies®, 8th Edition by Richard Blum, Dee-Ann LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting Wildcard Expansion to Good Use

Computing life would be tedious if you had to repeat the same command on multiple files. After all, aren’t repetitive tasks what the computer was designed to do? Wildcard expansion refers to the ability of one command to be executed against many files. The asterisk (*) and the question mark (?) are two wildcard characters that are used to match any filename, or a portion of a filename. For example, you can use the following command to see a long directory listing that includes only files that end with a .doc filename extension:

 ls -l *.doc                                                         

The files listed may include resume.doc, cover_letter.doc, and to_editor.doc, for example.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required