The Linux Cookbook is a collection of hints, tips and how-tos for dealing with GNU/Linux systems, along with an introduction to the history and ethos of free software, in the style of a Chinese cookbook. Your reviewer is not making this up; it says so, right there on page 6: 'Buwei Yang Chao's "How To Cook and Eat In Chinese" served as much of the inspiration behind the tone and structure of this book'. Moreover, knowing what I do about GNU/Linux, and after reading this book, I am tempted to get hold of the Chinese cookbook as well.
To put it tersely, this book is flavourful. It feels right, it feels like the kind of book it should be for the job it has set out to do. It's typeset in TeXinfo, which communicates its free-software pedigree on first glance. The "recipe-oriented" structure allows Stutz to take complexities, chop them up into bite-sized problems, and eat them up one at a time.
Since the recipes are numbered, fore-reference becomes trivially easy, and the book thus avoids a major hurdle at which many UNIX books fall: that you need to know something about everything before you can learn about anything.
To illustrate: if I want to teach about shell work, say how to list files in your home directory, I have to cover logging in, or the student has no shell. In order to cover logging in, I also have to mention the X windowing system, or the student will be confused if her terminal runs an xdm faceplate. Having mentioned X, I might as well tell a user who isn't running X how to start it, so we can all be at the same place. In order to start X, I have to tell the user how to check that the right files are in his home directory - which takes us back to the beginning of the paragraph.
By numbering the recipes, Stutz doesn't have this problem. For example, on page 35, he starts to handle shell commands. He mentions in passing that you might be logged in as root, and if you are, he points to a recipe 328 pages later on which tells you how to create a new user account. Thus, exceptions can be handled without forcing unneeded complexity down the reader's throat. It's a great technique for this material.
He also has two contents sections, which adds to clarity - a broad overview page, and a 16-page high-definition contents - and a "how little of this book can I read and still know the basics" section, which is also good. Two indices (datum and concept) sit at the other end of the book, and further improve the book's usability. This material can easily overwhelm, and he's taking every pain to prevent all the complexity from landing on the reader at once, in a giant, disheartening lump.
This book is written for people coming from a non-Linux background who would like to do similar things with their Linux box to those they're used to doing on their old machine. After he covers UNIX environment basics, he gets into a fair amount of desktop detail, covering text editing and desktop publishing, viewing and editing images, hearing and editing audio streams, printing, personal productivity tools, and networking. A small, but necessary, appendix on being a sysadmin wraps the bulk of the book up. On the way, he takes in a huge number of little hints and tools. One of them, "seq" on page 299, is exactly the tool I've been looking for for the past thirteen years of writing DNS zone files. It's always been there, but I hadn't known that, and now I do. Stutz notes in the prefatory material that he hopes even wizards might learn something; well, this one did.
But I'm not completely enamoured by the book. Several times, Stutz confuses policies arising from convention with those arising from configuration. This confusion sometimes leads to statements that are nearly wrong. For example, comments at the beginning of Chapter 6 about the primary group membership of users are only true on debian becasue the default configuration makes them so, and are false on some other distributions.
Sometimes he oversteps even that mark and makes statements that are flat-out wrong. Recipe 5.7 makes it clear that he doesn't understand hard links; one of the examples simply won't behave as he says it will, and I'm forced to wonder if he's ever tried it.
More grumbles: his chapter on shells is bash-specific. Fair enough, it's the default shell of more Linux users than any other shell, but I don't feel he goes far enough in letting people know that nearly every feature of their command-line interface is shell-specific. If they move onto csh for some reason, nearly none of what he says will be true. This isn't made clear.
Although he discusses globbing (using special wildcard characters to represent groups of files to utilities), he fails to note that the shell globs the regexp (expands the pattern of special characters), not the utility. This might seem a trivial issue, but failure to note it leads to problems later: part of recipe 7.1 won't work as he says it will, instead returning an error under most circumstances. More dangerously, one of his techniques for removing files with odd names (recipe 5.6.1) can in fact backfire under certain conditions and will silently remove every file in the affected directory, and every file and directory underneath it, except the one you were trying to remove. Again, I have to wonder if he's tried all his examples. Oddly, on page 310 he makes it clear that he does understand the globbing issue, so why he hoards this dangerous knowledge until then isn't clear to me.
In the end, the recipe-oriented nature of the book makes it too bitty; it's impossible to read from cover to cover, but then that's not really what it's for. Take it a few chapters at a time, dip in when you need a particular answer, and everything will be fine.
Really, this is a great book about using Linux; one of the best I've read. If you were thinking of trying to get to grips with Linux, you need this book really badly, right alongside your distro and its installation guides. If you're been using Linux for a while but want to cross-correlate all your knowledge, and feel less like a collection of recipes yourself, this is the book to set it all in context. Even power users will find the odd hint and tip. As I hope I've shown, all of us can learn from it - perhaps even the author!
© Tom Yates, 2001