O'Reilly logo

Linux and Unix Shell Programming by David Tansley

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

Chapter 4. Filename substitution

When working on the command line, quite a bit of your time will be spent locating files that you want to work with. The shell offers a neat set of pattern matching or metacharacters that enables you to match filenames based on the pattern you supply. You can also use character classes to match filenames. But as it’s quicker using the metacharacters on the command line, we will stick with these in this chapter.

In this chapter we will cover:

  • pattern matching using any character string;

  • pattern matching using single characters; and

  • pattern matching using alpha or numeric characters.

Here are these special characters.

* Matches any string including a null string.
? Matches any one character.
[...] Matches any characters ...

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