cli_text_processing_coreutils icon indicating copy to clipboard operation
cli_text_processing_coreutils copied to clipboard

Example based guide for specialized text processing with GNU Coreutils

Command line text processing with GNU Coreutils

You might be already aware of popular coreutils commands like head, tail, tr, sort, etc. This book will teach you more than twenty of such specialized text processing tools provided by the GNU coreutils package.

My Command Line Text Processing repo includes chapters on some of these coreutils commands. Those chapters have been significantly edited for this book and new chapters have been added to cover more commands.

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


E-book

You can purchase the book using these links:

  • https://learnbyexample.gumroad.com/l/cli_coreutils
  • https://leanpub.com/cli_coreutils
  • You can also get the book as part of All books bundle from https://learnbyexample.gumroad.com/l/all-books
  • See https://learnbyexample.github.io/books/ for list of other books

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 pdf/epub 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


Feedback and Contributing

Open an issue if you spot any typo/errors.

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

I'd also highly appreciate your feedback about the book.

Twitter: https://twitter.com/learn_byexample


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