Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Chapter 7. Pattern Matching

A number of Linux text-processing utilities let you search for, and in some cases change, text patterns rather than fixed strings. These utilities include the editing programs ed, ex, vi, and sed; the gawk programming language; and the commands grep and egrep. Text patterns (called regular expressions in computer science literature) contain normal characters mixed with special characters (called metacharacters).

Perl’s regular expression support is so rich that it does not fit into this book; you can find a description in the O’Reilly books Mastering Regular Expressions by Jeffrey E.F. Friedl, Regular Expression Pocket Reference by Tony Stubblebine, Perl in a Nutshell by Nathan Patwardhan et al., or Perl 5 Pocket Reference by Johan Vromans. The Emacs editor also provides regular expressions similar to those shown in this chapter. See the O’Reilly books Learning GNU Emacs by Debra Cameron et al., or GNU Emacs Pocket Reference, also by Debra Cameron, for details.

This chapter presents the following topics:

  • Filenames versus patterns

  • Description of metacharacters

  • List of metacharacters available to each program

  • Examples

For more information on regular expressions, see the aforementioned O’Reilly book Mastering Regular Expressions.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page