5 ms·
Show HN: “Command line text processing with GNU Coreutils” eBook
- tyingq 5y agoBookmarked, 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.
- asicsp 5y agoThanks. >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.
- jph 5y agoGreat 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.
- mongol 5y agoI 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.
- jstanley 5y agoWhich ones do you think are esoteric?
- Xophmeister 5y agoThey 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.)
- riffraff 5y agofor 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-invocation.html#comm-invocation https://www.gnu.org/software/coreutils/manual/html_node/comm...
- Xophmeister 5y ago`comm` and `join` are like super powers to those who don't know about them :)
- cauthon 5y agoIf 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
- asicsp 5y agoYou 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)
- aaaaaaaaaaab 5y agoAlso check out `paste`!
- SavantIdiot 5y agoBueno! 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.
- neonological 5y agoCookbooks are great and tutorials are great. I wish there were a place where I have access to thousands of exercises that help me internalize these concepts. This is where I really have trouble. In my daily work I regress to old habits with Ctrl shift f in my ide rather then something like ripgrep.
- asicsp 5y agoHello! 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_coreutils 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://learnbyexample.gumroad.com/l/cli_coreutils * https://leanpub.com/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 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 https://leanpub.com/b/theindiepythonextravaganza/c/pytober
- chintler 5y agoThank you for writing and making your books available. I just wish there was some way I could buy them with UPI.
- asicsp 5y agoI 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 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.