I had not noticed that there was a new edition of "The Linux Command Line" until today.

If you use Linux, and perhaps especially if you are new to Linux, and want to get to grips with command line / terminal usage, it is well worth dipping into this free (CC BY-NC-ND) tome:

https://www.linuxcommand.org/tlcl.php

#books #Linux

Linux Command Line Books by William Shotts

Linux Command Line Books by William Shotts

I am not telling anyone else how to Linux, but when I first started using it, I found this kind of thing invaluable.

I had, I think, a smaller book, "Linux Pocket Guide: Essential Commands" and that was so helpful too.

I am sure that one could use Linux without touching a terminal but, for me, the terminal is a fantastic and useful way of computing, and so upskilling in its usage has been time very well spent.

(See also books like "Practical vim" or "tmux in practice".)

@neil I bought a copy of "UNIX In A Nutshell (updated for System V R4!)" in the mid 90s and it's still my go-to reference for all things POSIX.

The spine is broken on the pages for grep, awk, sed, nroff and vi 😁

@greem I wish that I knew awk better than I do, tbh.

@neil (G)AWK is definitely worth the time. Simple use is almost trivial and suddenly there are things that were awkward that are now ready one-liners.

Very easy to fall into the trap of doing overly clever things, but absolutely it's worth the investment.

CC: @greem

@ColinTheMathmo @neil @greem

This is going to sound as if I'm trying to start a language war, but I'm not.

I'm genuinely surprised that people use Awk when Perl is available. I always think of Perl as having superseded Ask. What's the appeal of Awk nowadays? What am I missing? Is it just that Perl has a bad reputation because of all those dollar signs?

@CppGuy Reasonable question, and I will answer when I can sit at a proper machine and compare my thoughts. It will very much be a personal opinion.

But just now I am in a cafe halfway between home and a visit to a family member, so have not the time.

But will reply.

CC: @neil @greem

@ColinTheMathmo

Personally it's all down to preference. I've been using grep/sed/awk for so many years that even writing "perl -le '_script stuff here_" feels like overkill.

I regularly still write in Perl, bash and nowadays Powershell (mainly for interoperability with Windows and M365 stuff), but sometimes being able to let my brain freewheel and use the older tools achieves the same end.

TMTOWTDI, after all!

@CppGuy @neil

@greem @ColinTheMathmo @neil

Ah, now grep I do use, umpteen times a day. For cases where its regex support is capable enough (which is nearly all of them), it's much more convenient, and probably faster, than a Perl say if /.../ one-liner.

Perl was available to me (in the mid-90s, on Windows, as BigPerl 4.0.36) before sed and awk were, or at least before I found them, and I guess that's why I never learned them even after moving from Windows to Linux.

@CppGuy Right, so the first and main reason is that I found AWK before Perl and became *really* comfortable with it very quickly.

Secondly, when Perl came along and I started to look at it, I found it difficult to impossible to convert half my programs, because *lots* of my programs follow the underlying structure of:

/Pattern/ { Action }

Re-creating that structure in Perl seemed ... sub-optimal.

It also seemed sub-optimal to learn two languages that fill very similar paces. In my experience there are few places where Perl is clearly better than AWK.

And I always found problems understanding how Perl thinks about variables, whereas in AWK I can see *exactly* what's going on. Perhaps the tutorials I started with were poor and I was left with a bad impression, but certainly my mental model of "how things work" was broken multiple times as I tried to understand Perl programs, and write my own.

So I never got "off the ground" with Perl.

I don't know it well enough to provide a clear critique of the language itself ... hence this is all just my experience.

CC: @neil @greem

@ColinTheMathmo @neil @greem

Thanks — that's interesting and also completely valid. Different programming languages suit different people. And three of us, in different ways, have now said we found something we liked and didn't really see a reason to change, or encountered friction when we tried to change.