Articles / The Linux Cookbook

The Linux Cookbook

On my Linux Users Group's mailing list, an old question recently surfaced again: What book would you recommend for someone who is new to Unix (but not to computers)? I didn't have any suggestions at the time, but after looking at "The Linux Cookbook", I do. It's a book I wish I'd had when I started, and one I'm happy to have beside me now.

So much has been made about Unix culture as a literary tradition that we tend to overlook how much of the community's knowledge is transmitted orally. Books and manpages teach the use of Unix tools, but the design of Unix, the fact that there are so many small tools and mechanisms for combining them, means that it's left to us to come up with ways they can be made to work together to solve our problems. Students of Unix may start with books, but at some point, there will inevitably be a period of talking over ideas or watching over someone's shoulder, whether it happens with classmates, coworkers, or friends at user groups meetings.

We each learn our little tricks and pass them along. We incorporate what we pick up from others, use it to do something new, pass that back into the stream, and around it goes. Reading The Linux Cookbook, you might get the impression that Michael hung around LUG meetings, jotting down neat ideas people shared. It reads like the minutes of a Q&A session organized into topics.

Most books cover the ingredients. This one takes a fresh approach by working backward from what you really want to know. While most books start with the tools available and work toward what you want to accomplish, The Linux Cookbook starts with your problem and suggests tools that could solve it.

The table of contents lists all the recipes in chapters that divide into seven large sections:

  1. Working with Linux
  2. Files
  3. Text
  4. Images
  5. Sound
  6. Productivity
  7. Networking

This structure lets you quickly find the answers to a wide range of questions that you'd be hard pressed to find in other texts. Examples include:

  • "How can I take a screenshot of a console?"
  • "How can I quickly print a poster from text I give on the commandline?"
  • "How can I fetch a copy of all or part of a Web site?"
  • "How can I check check for doubled words in something I've written?"
  • "How can I have a list of my appointments emailed to me every morning?"
  • "How many cups are in a liter?"

It's by far the most entertaining Unix book I've ever read, and the only one I could recommend without reservations to people who already have basic Unix skills. With other books, someone who's moved past the beginner stage will be stuck reading the same material over and over again, looking for the joy of a new idea that the author drops unwittingly. In those books, the author's goal is not to offer new ways of using tools the reader already has at hand; she only does so by accident when her way of introducing the tools happens to be different from what the reader is used to. In The Linux Cookbook, matching tools to tasks is the goal, and the occasional fun found in traditional Unix texts runs this book through from cover to cover.

It should have a broad appeal to people with many different levels of knowledge. The newbie and the guru can both find something of interest here. It's easy to use as either a textbook or a reference. The newbie can read it straight through. The guru will find, in addition to an exceptionally well-structured table of contents and the expected concept index, a program index which lets her find references to specific applications. If you're looking for new tricks to play with grep, it will suggest 16 pages to try.

Sometimes, I flip through it looking for new ideas. Other times, I'm about to do something and stop to wonder if there's a better way. Picking up the cookbook, I'll often find a pleasing answer.

An unusual book in other ways, as well

No Starch Press, the publishers of The Linux Cookbook, should be applauded for handling this project with remarkable integrity. From the outset, Michael had clear ideas about what he wanted to do. He would only cover software that's Free. There would be no discussion of Netscape, Star Office, etc. As an extension of that decision, he would emphasize Debian to the expense of other distributions. Most alarmingly, he would insist that the book be licensed under his own Design Science License. Like the GPL, this license would require that the book, in addition to being sold in paper form, be freely available in both human-readable and source form on the Net.

It's to No Starch's credit that they gave their full support to the plan. There are precedents for publications like this (see O'Reilly's Open Books Project), but not every publisher would be willing to be so flexible with an author.

The result is that you don't have to buy the book to read it; you can find the entire text right at http://www.dsl.org/cookbook/. In fact, if you use Debian, you can do this:

apt-get install linuxcookbook

and you'll soon find yourself with your own copy.

I don't mean to suggest that you'd be wasting your money by getting a copy at your neighborhood bookstore. There are many benefits to printed books, especially for new users, and I think buying the paperback edition would be a good investment.

The bad news

The book does have its problems, which center around Michael's biases. You get lots (and I mean lots) of Emacs, and lots of Debian. If you don't use either, some of the information may not be useful to you. Other choices are completely baffling. He teaches how to write PPP scripts; would it have hurt to mention that most people don't bother and use a frontend like pppconfig, WvDial, or kppp? He discusses ICQ clients; why not talk about other IM services such as AIM? Just pointing to Everybuddy and Jabber would have covered all the bases. His suggestions for an addressbook application are:

  1. A text file and grep.
  2. bbdb (useless if you don't use Emacs).

It would have taken only half a page to mention a couple of the many other addressbooks available which offer features like integration with mail clients and PDA syncing.

Most troubling of all, he discusses telnet but only mentions SSH as something your (apparently over-zealous) sysadmin might force you to use. He doesn't even mention that openssh is in Debian. He explains how to use ftp (no mention of ncftp?) to transfer files, but there's not a peep about scp or rsync. I think it's a huge mistake to write a book that will be read by beginners and not instill basic security consciousness in them.

The silver lining

As described above, the book itself is an open project. You can grab the texinfo source from the Web site and make any changes that you think would improve it. As a collection of common wisdom, The Linux Cookbook is quite rich, considering that it was compiled by one diligent person. Think how much richer it could be if readers submitted patches! If someone were willing to coordinate the effort, an already good book could get better and better. Someday, Michael could even take the changes back to No Starch for a second edition. I can't think of a more appropriate ending for a book of the community than that the members of the community should make the improvement and maintenance of it a project of their own.

Recent comments

15 Jun 2002 20:35 Avatar linuxknight

NcFTP?
Why would anyone in their right mind use NcFTP? It is
propritary, (Not even GPLed!) so why would any true Linux
person use it?

Screenshot

Project Spotlight

Kigo Video Converter Ultimate for Mac

A tool for converting and editing videos.

Screenshot

Project Spotlight

Kid3

An efficient tagger for MP3, Ogg/Vorbis, and FLAC files.