Goal: become a proper neckbeard. I've read OSTEP (highly recommend as an operating systems 101 resource), and now I'd like a practical guide that goes over topics like:
- the Unix kernel
- how the filesystem is organized
- useful Bash/Shell utilities, etc.
- the sequence of events when I start a shell
- how to use subshells?!
- useful /etc files
- which of the 15 methods for bash expansion to actually use
- advanced SSH
Cuz I've been learning about all of these in a non-organized way for the last 5 years and I still stumble over all of them, so let's try learning about them systematically.
Myles' general guidance: "i don't know if this metaphor is useful but i've been using it recently: you can think of the kernel as a singleton object (i.e. you can't make another instance for testing without booting a whole new machine) with tons of private state and hundreds of methods. bash shell is just the most popular "high level wrapper" (like jquery) for it. all languages also wrap the kernel, but they tend to reimplement a bunch of stuff (like threads) so they can wrap more than one kernel (windows, bsd, etc). even c wraps the kernel. if something's consistently confusing, it always helps to ask "what does the kernel side of this look like? what are it's private data structures and methods?" because those are "unwrapped" and they have to be small and fast and simple"
The first book I asked people about was Unix Power Tools, 3rd Edition:
- Myles: "yep, it's a classic. i think old editions are even free online"
- Bartosz: only OK, it covers lots of weird, irrelevant ground (RCS? xterm? etc)
People recommended this instead: The Linux Programming Interface
- Bartosz: the classic
- Oz: i’ve never seen that one before, and actually don’t know of what i’d suggest for learning the BSD/GNU general commands other than section 1 of the manual for linux itself 😛
Bartosz: "supplement TLPI with a Bash-specific resource, like the Bash Reference Manual (BRM)"
This guy on Quora suggests two others: "Once you've graduated from the Advanced Bash-Scripting Guide, I'd suggest the much more useful Greg's Wiki (especially the Pitfalls article). It's the single most useful Bash resource out there (please someone prove me wrong), and significantly, is an active (and actively moderated) wiki with even anonymous editing."
- My take: the Advanced Bash-Scripting Guide assumes no programming knowledge, meh.
- Bartosz on Greg's Wiki: "oooh, yes, Greg's wiki! no, really, don't skip it. it explicitly brings your attention that the official docs often inadvertently skip over. especially the pitfalls thing is extremely practical. basically it's super useful to have a resource written from a cranky old graybeard perspective of "okay, here's how Bash will try to kill you, plan accordingly"
I also checked out Amazon's best sellers in the Unix Shell category and the first place result was the Linux Command Line and Shell Scripting Bible (LCL&SSB) which seems to cover all of the topics I highlighted.
The remainder of their best-sellers seem like one-off/inexhaustive O'Reilly books.
- Bartosz: "LCL&thisistoolongtoremember also seems like a 10/10 score, Bartosz-approved on all counts"
This guy on Quora echoes TLPI, LCL&SSB, and BRM.
Given Myles' advice to learn the kernel, I'll start with TLPI. And I'll keep LCL&SSB as a reference because, well, it's only $20. And I'll throw in the Pitfalls article from Greg's Wiki for good measure.
Bartosz: "Oh, for general Linux neckbeard upkeep, can't beat LWN:
https://lwn.net/Archives/ (This actually has nice writeups on things that are new and getting developed.)"