O'Reilly logo

A Practical Guide to Red Hat® Linux® 8 by Mark G. Sobell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required