Chapter 6. The awk Utility

The awk Utility

What's awk? What's nawk? What's gawk?

Awk is a UNIX programming language used for manipulating data and generating reports. Nawk is a newer version of awk, and gawk is the GNU version used on Linux.

The data may come from standard input, one or more files, or as output from a process. Awk can be used at the command line for simple operations, or it can be written into programs for larger applications. Because awk can manipulate data, it is an indispensable tool used in shell scripts and for managing small databases.

Awk scans a file (or input) line by line, from the first to the last line, searching for lines that match a ...

Get UNIX® Shells by Example Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.