/cli_text_processing_coreutils

Example based guide for specialized text processing with GNU Coreutils

Primary LanguageShellMIT LicenseMIT

CLI text processing with GNU Coreutils

You might be already aware of popular coreutils commands like head, tail, tr, sort and so on. This book will teach you more than twenty of such specialized text processing tools provided by the GNU coreutils package. Visit https://youtu.be/oCnJLu_PUbY for a short video about the book.

CLI text processing with GNU Coreutils ebook cover image

The book also includes exercises to test your understanding, which are presented together as a single file in this repo — Exercises.md.

For solutions to the exercises, see Exercise_solutions.md.

See Version_changes.md to keep track of changes made to the book.


E-book

For a preview of the book, see sample chapters.

The book can also be viewed as a single markdown file in this repo. See my blogpost on generating pdfs from markdown using pandoc if you are interested in the ebook creation process.

For web version of the book, visit https://learnbyexample.github.io/cli_text_processing_coreutils/


Testimonials

In my opinion the book does a great job of quickly presenting examples of how commands can be used and then paired up to achieve new or interesting ways of manipulating data. Throughout the text there are little highlights offering tips on extra functionality or limitations of certain commands. For instance, when discussing the shuf command we're warned that shuf will not work with multiple files. However, we can merge multiple files together (using the cat command) and then pass them to shuf. These little gems of wisdom add a dimension to the book and will likely save the reader some time wondering why their scripts are not working as expected.

— book review by Jesse Smith on distrowatch.com

I discovered your books recently and they’re awesome, thank you! As a 20 year *nix they made me realize how much more there are to these rock solid and ancient tools, once you spend the time to actually learn the intricacies of them.

— feedback on reddit


Feedback

⚠️ ⚠️ Please DO NOT submit pull requests. Main reason being any modification requires changes in multiple places.

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, 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:


Table of Contents

  1. Preface
  2. Introduction
  3. cat and tac
  4. head and tail
  5. tr
  6. cut
  7. seq
  8. shuf
  9. paste
  10. pr
  11. fold and fmt
  12. sort
  13. uniq
  14. comm
  15. join
  16. nl
  17. wc
  18. split
  19. csplit
  20. expand and unexpand
  21. basename and dirname
  22. What next?

Acknowledgements


License

The book is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

The code snippets are licensed under MIT, see LICENSE file.