O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

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

Filename Substitution

It is frequently convenient to use so-called wildcard characters when typing in a command line. As the name implies, a wildcard character is a character that stands for zero or more other characters.

* Matches zero or more characters.
? Matches any single character.
[] Defines a set of characters.
{} Defines a set of character sequences.
^ Can be used to negate character set definitions.

The most powerful of the wildcards is the Kleene star, '*', which is the shift of the 8 on your keyboard. It will match any character string of any length. For example, to display all files beginning with the letter t, use the following command:

ls t*

To remove all files ending with the .txt extension and beginning with the letter c, ...

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