Skip to Main Content
Linux in a Nutshell, Fourth Edition
book

Linux in a Nutshell, Fourth Edition

by Ellen Siever, Stephen Figgins, Aaron Weber
June 2003
Beginner to intermediate content levelBeginner to intermediate
944 pages
43h 1m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, Fourth Edition

Metacharacters, Listed by Linux Program

Some metacharacters are valid for one program but not for another. Those available to a given program are marked by a checkmark () in the following table. Notes are provided after the table, and full descriptions of metacharacters are in the following section.

Symbol

ed

vi

sed

gawk

grep

egrep

Action

.

Match any character (can match newline in gawk).

*

Match zero or more preceding elements.

^

Match beginning of line or string.

$

Match end of line or string.

\

Escape following character.

[ ]

Match one from a list or range.

\( \)

Store pattern for later replay.

\ n

Reuse matched text stored in nth \( \).

{ }

Match a range of instances.

\{ \}

Match a range of instances.

\<

Match word’s beginning.

\>

Match word’s end.

+

Match one or more preceding elements.

?

Match zero or one preceding elements.

|

Separate choices to match.

( )

Group expressions to match.

On some Linux systems, grep is a link to egrep, so whenever you run grep you actually get egrep behavior.

In ed, vi, and sed, when you perform a search-and-replace (substitute) operation, ...

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

Linux in a Nutshell, 6th Edition

Linux in a Nutshell, 6th Edition

Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
Linux in Action

Linux in Action

David Clinton
Hands-On System Programming with Linux

Hands-On System Programming with Linux

Kaiwan N. Billimoria, Tigran Aivazian
Embedded Linux for Developers

Embedded Linux for Developers

Alexandru Vaduva, Alex González, Chris Simmonds

Publisher Resources

ISBN: 0596004826