Checking Only Specific Fields to Select a Line

awk is an extensive programming language that is available on all commercial UNIX systems. You can use a subset of it as a grep-like command-line utility that provides search and display capabilities not available in grep or egrep.

See Table 18.4 for other standard properties of the awk command.

Table 18.4. Other Properties of the awk Command
PropertySee page
Allows relative and absolute pathname arguments70
Processes either filename arguments OR standard input115
Changes only the output, not the file111
Allows a list of filenames and filename wildcards292
Allows output to be piped or redirected116

Displaying a Line if Exact Match in One Field

grep checks the whole line for a match. If you want to check ...

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.