O'Reilly logo

Practical Linux by Bill Ball, John Ray, Michael Turner, M. Drew Streib

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

Using Wildcards

Wildcards are used on the shell command line to specify files by name or extension. Shells for Linux offer sophisticated forms of wildcards that you can use to perform complex pattern matching. Creating complex wildcards is called building regular expressions.

Building Regular Expressions

Regular expressions are wildcard patterns, built using a special command-line syntax. This syntax uses a number of special characters, some of which are listed in Table 2.2.

Table 2.2. Common Regular Expressions and Characters
Expression Action
* Match all characters
? Match a single character
[a–z] Match a range of characters
[0123] Match a range of characters
\ ? Match the ? character
\ ) Match the ) character
^abc Match pattern ...

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