Chapter 18. Searching for Lines in a File or Pipeline

Steve “Mor” Moritsugu

  • Regular expression wildcards that can be used to find patterns

  • Extra pattern search capabilities in egrep, perl, fgrep, and awk

Tip for Beginners

This chapter covers searching for lines that contain patterns within files or output. The chapter first covers grep and its options in order of usefulness. Then, it covers special pattern-matching wildcards called regular expressions. These are a perfect example of why some people love the elegance and power of UNIX commands so much, and why others hate them for being cryptic and complex.

You should learn to use grep and some of ...

Get Practical UNIX now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.