
The AWK programming language
by Alfred V. Aho, Brian W. Kernighan, Peter Weinberger · first published 1988
117mentions
61recommended by
79HN commenters
2009–2026first – last mentioned
77% recommend23% neutral
Why HN recommends it
Concise, well-written tutorial and reference from the language's creators, in the style of K&R. It skips the basics, teaches Unix text processing and philosophy, and suits programmers who want to be productive fast.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








…potential improvements offered by 'awkcc'. Although perl was becoming the new hotness at that time, Awk remained my goto tool for many years. If you are interested in learning Awk, I highly recommend "The AWK Programming Language" by Aho, Kernighan, and Weinberger. It's about the same size as the original "The C Programming Language" and is equally well-written. Previously on HN: https://news.ycombinator.com/item?id=13451454
on “Learn just a little Awk (2010)” ↗…in one night and the following morning. (I'm on the second pass, doing most of the exercises, and nearly done with chapter 2. I'm taking a break, though.) _Thinking Forth_, by Leo Brodie et al. _The Awk Programming Language_ by Aho, Weinberger, and Kernighan. _Programming Pearls_ and _More Programming Pearls_ by Jon Bentley. I couldn't put _CTM_ (http://www.info.ucl.ac.be/~pvr/book.html) down, either. It took a while to…
on “Which programming book you just couldn’t stop reading from start to end?” ↗…needed to write useful programs in the world of quasi-structured (not quite CSV but not completely free form) data. You can learn the whole language and become proficient in an afternoon. I recommend "The AWK Programming Language" by Aho, Kernighan, and Weinberger, though it seems to be listed for a hilariously high price on Amazon at the moment. Maybe try to pick up a used copy.
on “Useful Unix commands for data science” ↗…' which is nice for more complex "one liners". Awk is also standard on all posix environments and in the mawk flavor is extremely fast (relevant if you are processing huge files). There is superb book, The AWK Programming Language, which teaches a lot about programming in addition to the awk language. Good discussion and link to pdf here: [0] [0] https://news.ycombinator.com/item?id=13451454
on “Batch editing files with ed” ↗One of my favorite books - I initially bought a copy based on a review by Brandon Rhodes [0]: > But the real reason to learn awk is to have an excuse to read the superb book The AWK Programming Language by its authors Aho, Kernighan, and Weinberger. You would think, from the name, that it simply teaches you awk. Actually, that is just the beginning. Launching into the vast array of problems that can…
on “The Awk Programming Language (1988) [pdf]” ↗After I recommended the Sed & Awk book here a few months ago, silentbicycle countered[1] that The Awk Programming Language[2] (by Aho, Kernighan and Weinberger) was much better. I was curious enough that I bought and read it just at the end of summer. It really is excellent. Highly, highly recommended. [1] http://news.ycombinator.com/item?id=1403376…
on “Why you should learn at least a little bit of Awk” ↗The post doesn't mention it, but the best source for learning awk is _The Awk Programming Language_ (http://cm.bell-labs.com/cm/cs/awkbook/) by Aho, Weinberger, and Kernighan. It's short and to the point, has a good tutorial and reference, and it's even co-written by Brian Kernighan. It's that good.…
on “Exercise #1: Learning awk Basics” ↗…from file, via mmap), and dozens of little scripts. I don't really care for shell scripting, but awk is great. If you want more stuff like this, check out _The Unix Programming Environment_ and _The Awk Programming Language_. Both co-written by Brian Kernighan.
on “Data Science Hand Tools: Unix Power tools Revisited” ↗I cannot recommend this enough: The Awk Programming Language - Aho, Kernighan, Weinberger https://ia802309.us.archive.org/25/items/pdfy-MgN0H1joIoDVoI... The book is amazingly well written, and is invaluable.
on “Seven Unix Commands Every Data Scientist Should Know” ↗The book "The AWK Programming Language" by Aho, Weinberger and Kernighan is a real gem. Chapter 6 is "Little Languages", it shows you how to write interpreters and compilers using AWK. In particular it even shows how to start a bootstrap:…
on “Turing Award goes to Aho and Ullman” ↗You can't go wrong with any programming books Brian Kernighan co-wrote, really. I have _The ANSI C Programming Language_ ("K&R"), _The Practice of Programming_, _The AWK Programming Language_, and _The Unix Programming Environment_, and they're all great. Concise, with a lot of depth that reveals itself on repeat reading. Ieursalimschy's _Programming in Lua_ ("PiL") was written in a similar…
on “Why you should learn at least a little bit of Awk” ↗…had high I-want-to-read-itosity, I thought: Abelson and diSessa, Turtle Geometry Abelson and Sussman, Structure and Interpretation of Computer Programs Aho and Weinberger and Kernighan, The AWK Programming Language Andrew Appel, Compiling With Continuations Jon Bentley, More Programming Pearls Jon Bentley, Programming Pearls Leo Brodie, Thinking FORTH W. H. Burge, Recursive Programming Techniques…
on “Which programming book you just couldn’t stop reading from start to end?” ↗If this article has made you more curious about Awk itself, I highly recommend The Awk Programming Language [1] by Aho, Kernighan and Weinberger. It's a terrific book all around (look at the list of authors), and Awk really is worth knowing if you use the command line a lot. (Credit where it's due: silentbicycle…
on “AWK-ward Ruby” ↗The Awk Programming Language[1], by Aho, Kernighan and Weinberger, has a whole chapter on using Awk as a relational database engine. (They implement a small query language in Awk itself.) It's also a great book period. [1] http://cm.bell-labs.com/cm/cs/awkbook
on “Why you should learn just a little Awk - A Tutorial by Example” ↗IIRC Aho, Weinberger, and Kernighan's excellent slim tome _The Awk Programming Language_ implements something similar; awk is used to generate the awk with Field1 replaced by $1, etc.
on “Csvkit - command line utilities for working with csv files” ↗