I am pleased to announce a new version of my CLI text processing with GNU grep and ripgrep ebook. Examples, exercises, solutions, descriptions and external links were added/updated/corrected. The chapter on ripgrep was changed significantly to focus mostly on the differences compared to GNU grep.

This book will help you learn these commands step-by-step from beginner to advanced levels with hundreds of examples and exercises.

Release offers🔗

To celebrate the new release, you can download PDF/EPUB versions of CLI text processing with GNU grep and ripgrep for FREE till 21-May-2023. You can still pay if you wish ;)

Other offers:

What's new?🔗

  • Command versions updated to GNU grep 3.10 and ripgrep 13.0.0
  • Many more exercises added
  • PCRE chapter — added section for conditional grouping, corrected description and examples for \K, atomic grouping, etc
  • ripgrep chapter — options and regex section modified to present only differences compared to GNU grep, added details for more options such as --field-match-separator, improved recursive search section, etc
  • Long sections split into smaller ones
  • In general, many of the examples, exercises, solutions, descriptions and external links were updated/corrected
  • Updated Acknowledgements section
  • Code snippets related to info/warning sections will now appear as a single block
  • Book title changed to CLI text processing with GNU grep and ripgrep
  • New cover image
  • Images centered for EPUB format


On this blog, I post tips covering Python, command line tools and Vim. Here are video demos for these tips:

Interactive TUI app🔗

I also wrote an interactive TUI app based on some of the exercises from the ebook. Reference solutions are provided for both GNU grep and ripgrep.

Sample screenshot from the interactive TUI app for grep exercises

Table of Contents🔗

  1. Preface
  2. Introduction
  3. Frequently used options
  4. BRE/ERE Regular Expressions
  5. Context matching
  6. Recursive search
  7. Miscellaneous options
  8. Perl Compatible Regular Expressions
  9. Gotchas and Tricks
  10. ripgrep
  11. Further Reading

Web version🔗

You can also read the book online here: https://learnbyexample.github.io/learn_gnugrep_ripgrep/.

GitHub repo🔗

Visit https://github.com/learnbyexample/learn_gnugrep_ripgrep for markdown source, example files, exercise solutions, sample chapters and other details related to the book.

info See also my blog post on how to customize pandoc for generating beautiful PDF/EPUB versions from GitHub style markdown.


Subscribe to learnbyexample weekly — free newsletter covering programming resources, updates on what I am creating, tips, tools, free ebooks and more, delivered every Friday.

Feedback and Errata🔗

I would highly appreciate it if you'd let me know how you felt about this book. It could be anything from a simple thank you, Gumroad rating, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.

You can reach me via:

Happy learning :)