When it comes to command line text processing, from an abstract point of view, there are three major pillars — grep for filtering, sed for substitution and awk for field processing. These tools have some overlapping features too, for example, all three of them have extensive filtering capabilities.
Unlike grep and sed, awk is a full blown programming language. However, this book intends to showcase awk one-liners that can be composed from the command line instead of writing a program file.
This book heavily leans on examples to present options and features of awk one by one. It is recommended that you manually type each example and experiment with them. Understanding both the nature of sample input string and the output produced is essential.
Visit https://github.com/learnbyexample/lea... for code snippets and other related files used in the book.
If you know the basics of awk and want to improve your skills, but you're not ready to read The AWK Programming Language cover-to-cover, this book is your best next step. I've looked at dozens of books and websites, and this is the best-organized material, with the clearest writing and the most useful exercises. The topic choices and groupings are perfect. The coverage of regex is extensive.
The author keeps the book updated. The web version is available free, or you can buy the pdf and epub for $10 (as of May 2026).
If you're starting raw, you would be better off doing Exercism's Awk Learning track. But if you get partway through the Exercism exercises and bog down, get this book. You'll break through the bottlenecks and accelerate your progress.
One great reason to learn awk is as an intro to pattern matching. If you're coming from the C family, Python, JavaScript, or Ruby and want to learn a functional language like Erlang, Elixir, or F#, but you can't quite get your head around pattern matching, awk's pattern->action structure is a great bridge.
An invaluable resource for learning awk. The author does a good job of showing examples and explaining how they work. I particularly like the exercises at the end of chapters, making it more of an interactive learning experience.