Previous slide Next slide Back to the first slide View text version


Notes:

The grep command stands for Global Regular Expression Print. This command usually searches for a specified pattern match (character string sequence) within a text file; or series of text files. Standard output from a command can also be piped to a grep command as input.

There are three commands that are part of the grep family of commands:

If you're not finding the above comments to be true, read the manual pages as I've encountered very weird results on SUN Solaris 1.X systems (BSD based).

Some documentation exists, stating that fgrep is the fastest of the three commands. However, length in time to execute a grep command isn’t impacted by the command name: the time its takes to execute is predicated upon the complexity of the pattern match defined. Therefore, you’re encouraged to always use the egrep command when not specifying a fixed string match. This minimizes the risk that a pattern search will blow up. To be specific, consider when someone currently uses the grep command and now defines an extend regular which grep doesn’t support. This will lead to undesirable results.

This matter becomes much clearer when examining the next two slides.