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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.