grep, SED, and awk are all text processing tools, and although they all have their advantages and disadvantages, one text processing command cannot be completely replaced by another, or three text-processing commands will not appear. In comparison, however, SED and awk are more powerful and have been introduced in a separate language.
grep: Text filter, if only filter text, can use grep, its efficiency is much higher than others; Sed:stream editor, Stream editor, default only processing mode space, do not process the original data, if you process the data is processed for the row, you can use SED;
awk: Report generator, formatted for display later. If you need to generate information about the data you are working on, or if the data you are working on is column-based, you might want to use awk.
See: http://lq2419.blog.51cto.com/1365130/1238880
Three major text processing tools grep, sed, and awk Brief introduction