Trying to understand the differences between the two functions gawk vs. awk? When would one use gawk vs awk? Or are they the same in terms of usage?

Also, could one provide an example?

  • 1
    Googling found an answer here
    – user13742
    Jan 20, 2012 at 17:03
  • 1
    @hesse can you provide an example?
    – chrisjlee
    Jan 20, 2012 at 17:04

1 Answer 1


AWK is a programming language. There are several implementations of AWK (mostly in the form of interpreters). AWK has been codified in POSIX. The main implementations in use today are:

  • nawk (“new awk”, an evolution of oawk, the original UNIX implementation), used on *BSD and widely available on Linux;
  • mawk, a fast implementation that mostly sticks to standard features;
  • gawk, the GNU implementation, with many extensions;
  • the Busybox (small, intended for embedded systems, not many features).

If you only care about standard features, call awk, which may be Gawk or nawk or mawk or some other implementation. If you want the features in GNU awk, use gawk or Perl or Python.

  • 6
    Actually, the BusyBox awk is pretty close in behavior to gawk v3; I think it's more full-featured than nawk.
    – dubiousjim
    Apr 19, 2012 at 19:37
  • Good summary. A note for Debian users: The buster release included a 1996 release of mawk. The recent bullseye release brought us up to a 2020 version - 1.3.4. Oddly perhaps - at least on my RPi OS buster system - the 1996 mawk was never updated/upgraded during 3 years of use.
    – Seamus
    Feb 15, 2022 at 1:30
  • Update awk link in latest IEEE 1003.1-2017
    – hjl
    Nov 13, 2023 at 18:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .