gawk

Searches for and processes patterns in a file

gawk [options] [program] [file-list]

gawk [options] -f program-file [file-list]

The gawk (GNU awk) utility is a pattern-scanning and processing language that searches one or more files to see whether they contain records (usually lines) that match specified patterns and then performs actions, such as writing the record to standard output or incrementing a counter, each time it finds a match. You can use gawk to generate reports or filter text. It works equally well with numbers and text; when you mix the two, gawk usually comes up with the right answer.

The authors of awk (Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan), on which gawk is based, designed awk to be easy to use, and ...

Get A Practical Guide to Red Hat® Linux® 8 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.