IDG Contributor Network: The many faces of grep

Click here to visit Original posting

The grep command – likely one of the first ten commands that every Unix user comes to know and love – is not just a nice tool for finding a word or phrase in a file or command output. It can take on some vastly different personalities that allow you to more cleverly find the data that you are looking for and has more flexibility than many of its users have discovered.

Historically provided as separate binaries, the different “flavors” of grep are now provided through a number of key command options that change how grep interprets the pattern that you provide for your search. To easily switch from one mode of searching to another, the different grep commands could be set up as aliases such as these:

To read this article in full or to leave a comment, please click here