Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: “Command line text processing with GNU Coreutils” eBook (learnbyexample.github.io)
117 points by asicsp on Oct 12, 2021 | hide | past | favorite | 20 comments


Hello!

I'm excited to announce my latest book titled "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.

Plenty of examples are provided to make it easier to understand a particular tool and its various features. Resources for further exploration are also mentioned throughout the book. Visit https://github.com/learnbyexample/cli_text_processing_coreut... for code snippets, example files, markdown source and other details related to the book. The post link points to the web version of the book.

To celebrate the release, the ebook is free till Oct 15. You can get it from Gumroad or Leanpub:

* https://learnbyexample.gumroad.com/l/cli_coreutils

* https://leanpub.com/cli_coreutils

You can also get this book as part of a bundle with all my books published so far. It includes grep, sed, awk, perl, ruby one-liner books and five other books. Use this coupon to get the bundle for $5 - https://learnbyexample.gumroad.com/l/all-books/fiver

Hope you find this book useful. I'd highly appreciate your feedback. Happy learning :)

---

PS: Four of us indie authors came together for a free Python giveaway for entire month of October. The bundle includes Python 101, Pydon'ts, Practice Python Projects, Python re(gex)? and Clean Architectures in Python books: https://leanpub.com/b/theindiepythonextravaganza/c/pytober


Thank you for writing and making your books available. I just wish there was some way I could buy them with UPI.


I did have an option couple of years back, but there were hardly any buyers. So I closed that store instead of spending time in keeping them updated.

All my books are free to read online: https://github.com/learnbyexample/scripting_course#ebooks

Also, you could print to pdf using the markdown source from my GitHub repos or use tools like pandoc to convert markdown to pdf/epub.


>To celebrate the release, the ebook is free till Oct 15. You can get it from Gumroad or Leanpub:

This book is not free before or after 15 October.

Both sites linked require giving up PII in order to obtain the book.

It would be more accurate to say that the book doesn't cost money, not that it's free.

There's a real difference there.

That said, it looks like your book is a good resource. Thank you for writing it.

Edit: Had you included this link (https://learnbyexample.github.io/cli_text_processing_coreuti... ), you could make the claim that it's free.


I do not get your real difference point and I do not wish to argue your point.

Regarding your edit, this post itself points to the web version only (which I also mention in the comment you are replying to): https://learnbyexample.github.io/cli_text_processing_coreuti...


>I do not get your real difference point and I do not wish to argue your point.

Fair enough. I have no argument with you. In fact, I think it's great that you wrote this book. I'm sure it will provide a real benefit to many people. Again, thank you.

That said, the comment to which I replied said:

>(To celebrate the release, the ebook is free till Oct 15. You can get it from Gumroad or Leanpub:*

>* https://learnbyexample.gumroad.com/l/cli_coreutils\*

>* https://leanpub.com/cli_coreutils\*

The sites above are the folks with whom I have an issue, and I did, in fact, note that you make your work available anonymously for free via github.

I think that's great and appreciate your willingness to freely share knowledge and expertise.

My point wasn't about you or your book. Rather, it was about two of the sites (Leanpub and Gumroad) that distribute it.

All that said, my thoughts are orthogonal to the value and utility of your hard work. Again, thank you for doing so.


That’s generally the definition of free, yes. You might have a different definition, but it’s certainly not a common one.


>That’s generally the definition of free, yes. You might have a different definition, but it’s certainly not a common one.

Do you, given the environment of "surveillance capitlism" on the 'net, believe that PII is without value?

I'd posit that if there's an exchange of value (the book for PII), then it's not a "free" transaction.

And you're correct, that's not the "common" definition. However, ISTM that unless we use more precise definitions, we're unlikely to change perceptions around the gathering of PII that would have been far beyond anything the Stasi[0] could have dreamed.

And while my comment appears to have been interpreted as an attack on the author (it wasn't), I still believe it's an important issue to address.

I'd note (as I did in an edit to my original comment) that the author does make all his works available for free (by my use of the word) via github.

I hoped that my comment would spur thought on the part of other HN readers WRT surveillance capitalism.

I suppose you could argue that it's off-topic to reference this, but such activity (by Leanpub and Gumroad, not the author) is becoming so widespread that no one seems to be considering it at all.

That's a mistake in my view. Hence my comment.

[0] https://en.wikipedia.org/wiki/Stasi


Great work-- I'm buying all your books with your $5 coupon link.

HN folks often discuss ways to help open source, and ways to fund work that improves the open source ecosystem. In my opinion, your books are a superb way for more people to learn more about how to use open source tooling, and also to pay you a good fair price for your writing.


Bueno!

I've said it a million times: if you're trying to do any kind of text processing on the *nix commandline, you can be 99.999% certain someone wrote a tool for it in the 80's.


Bookmarked, looks interesting. I'm curious if you ran into cases where limiting yourself to just coreutils made things odd. Text processing without awk, for me, would be hard. Cut is janky about leading spaces, for example...it sticks to a pure delimiter mantra.


Thanks.

>I'm curious if you ran into cases where limiting yourself to just coreutils made things odd.

I wasn't limiting myself here, text processing with Coreutils was just one of the book ideas I had. I have already written separate books about grep, sed, awk, perl and ruby one-liners.

On my todo list, I have text processing with Rust tools (ripgrep, frawk, hck, etc) and then working with json, xml, etc.


I wonder how many coreutils commands that really are "core". Certainly cat, head, tail and a few more. But some of the others feel really esoteric, and I don't know if knowing them really helps you to solve problems faster. I think knowledge of perl, awk or sqlite will help much more.


Which ones do you think are esoteric?


for me: comm[0]. It's super useful when you need it, but I've never seen it used by anyone else but me.

[0] https://www.gnu.org/software/coreutils/manual/html_node/comm...


`comm` and `join` are like super powers to those who don't know about them :)


If I'm reading the man page correctly, the following two commands are almost equivalent?

$ comm -12 file1 file2

$ fgrep -w -f file1 file2

but `comm` generalizes to accommodate lines with whitespace, instead of single words? although it requires the files to be sorted.

That's actually a super useful tool to know about


You can use `-x` option to compare whole lines. So `grep -Fxf` is similar to `comm -12` (this will differ if there are duplicate lines within a file)


Also check out `paste`!


They definitely exist on a spectrum. Some are used super-regularly, others I've never heard of. `ptx` and `tsort` come to mind as esoteric; I'm not even sure what `ptx` does! Some are a bit redundant, as well (e.g., `dir`, `link`, etc.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: