Pattern Matching and Regular Expressions

In earlier lessons, you were introduced to the use of the wildcard symbol (*), used to help you find files that you need, or to find contents within a file. Used in conjunction with grep, you can find anything in your Unix system at a very granular level. This, of course, is because of the use of regular expressions. In this section of the lesson, we will look at how to use REs to search for content within a file. This can be helpful if you have saved email you want to parse for information or specific content, or a long file where you are only searching for a company name such as “Que” or “Sams.” Using REs, this information can be found quickly. Let's make a file and then use REs to search within it for ...

Get SAMS Teach Yourself Unix in 10 Minutes 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.