GNU awk (gawk)
A pattern-scanning and text-processing language.
awk reads text records (typically lines), applies pattern-action rules, and prints transformations. The original awk from Bell Labs was named after its creators (Alfred Aho, Peter Weinberger, Brian Kernighan) and shipped with Version 7 Unix in 1979. gawk, the GNU implementation, is now the version most Linux users run, with extensions such as gettext for internationalisation, a network module, gawkextlib for dynamically loaded extensions, and a debugger.
awk's strength is one-line text-processing tasks: print every fifth line, sum a column, reformat a CSV file. The pattern- action grammar makes such transformations expressible in a few characters, where the equivalent shell or Perl would be substantially longer.
Arnold Robbins has maintained gawk since 1994 and is the lead GNU awk developer. The codebase is mature and slow-moving, with releases focused on incremental improvements and bug fixes. awk competes for the same niche as sed and Perl one-liners, and all three remain in daily use.
Install
Debian/Ubuntu: sudo apt install gawk Fedora/RHEL: sudo dnf install gawk Arch: sudo pacman -S gawk macOS: brew install gawk
Authors
- Alfred Aho, Peter Weinberger, Brian Kernighan (original awk)
- Arnold Robbins (gawk maintainer)