Linux

Review: The best Linux book available

A thick, heavy book with the equally weighty title <em>A Practical Guide to Linux Commands, Editors, and Shell Programming</em> may be the single most important Linux book you ever buy.

In 2005, the year it was published, I bought the first edition of A Practical Guide to Linux Commands, Editors, and Shell Programming by Mark Sobell. The title reads like a nutshell description one might find in the Product Description section of its Amazon page, rather than like a book title. If you think the title is a handful, you should pick up a copy of the book; it is huge, a hefty tome filled from cover to cover with explanations of a wide range of topics relevant to the operation of a Unix-like operating system via the command line interface.

I had my copy of the book for maybe three months -- already a well-thumbed reference on my shelf, and I returned to it over and over again -- when I posted a brief review at Amazon:

This book is the best distro-agnostic foundational Linux reference I've ever seen, out of dozens of Linux-related books I've read. It's a constant battle to find a good Linux book that isn't wedded implicitly or explicitly to a specific distribution (usually something Red Hat related), more about KDE and GNOME applications and other specific applications the authors favor than about real Linux skills, or both. Finding this book was a real stroke of luck. If you want to really understand how to get things done at the command line, where the power and flexibility of free unixlike OSes really live, this book is among the best tools you'll find toward that end. About the only way it could be better is to be released under an open documentation license.

I was not the only person to give such a positive review. In fact, mine was modest by some standards. Out of 61 reviews at Amazon, nine of them gave the book four stars. The rest were all five-star reviews.

I have continued to use it heavily over the intervening years until, in 2009, the publisher contacted me about my Amazon review and asked whether I would consent to being quoted in the listing of reviews inside the second edition. After discussing it with them, we agreed on a distillation of the essence of my Amazon review that reads:

This book is the best distro-agnostic foundational Linux reference I've ever seen, out of dozens of Linux-related books I've read. Finding this book was a real stroke of luck. If you want to really understand how to get things done at the command line, where the power and flexibility of free UNIX-like OSes really live, this book is among the best tools you'll find toward that end.

Aside from reading this again, in print within the book's frontmatter, and realizing I should have been a touch less repetitive in my choice of phrasing, I find my opinion has not changed. The only change I would make to the message conveyed by my Amazon review is replacing the word "documentation" with "content" when referring to licensing. To my delight, the publisher sent a copy of the second edition to me as a "thank you" for the brief review.

Since the first edition, another fifty pages have been added, give or take. Due to the subject matter, there was little danger of most of the material in the book becoming obsolete, but where needed it has been updated for the current edition. It benefits from the addition of some new materials, as well as covering the same subjects as in the first edition. As described on the front cover of the first edition, the book provides (among other things):

  • A comprehensive, practical guide plus an outstanding reference with hundreds of realistic, high-quality examples!
  • Covers 80+ core utilities, shell programming, editors, and programming tools
  • Become a true Linux guru: Master the powerful Linux command line, from the ground up

The second edition alters that text slightly:

  • Get more done faster, and become a true Linux guru by mastering the command line!
  • Learn from hundreds of realistic, high-quality examples
  • NEW! Coverage of the Mac OS X command line and its unique tools
  • NEW! Expert primer on automating tasks with Perl

This weighty tome has plenty of room to fill with good information about how to get friendly with a Unix-like operating system, and Sobell did not waste much space. The density of knowledge contained between its covers is prodigious, well-organized, and quite thoroughly relevant. This book is clearly designed with both beginners and experts in mind -- a promise made by many books, but truly fulfilled only by a very rare few, including this specimen.

The choice of subject itself lends to the quality of the work. A common approach to trying to "teach" Unix and Linux to people in a book involves telling people where to click when using GNOME, how to install Fedora Core Linux, and similarly ephemeral, time-sensitive information of very limited applicability. By focusing on the command line, Sobell ensures that the whims of GUI designers and Linux distribution development teams will not render the majority of the book's information the least bit obsolete, and that the knowledge gleaned from it will serve the reader well across a wide range of platforms.

Contents

The second edition claims coverage that supports at least CentOS, Debian, Fedora, Mandriva, Mint, OpenSUSE, Red Hat, and Ubuntu, as well as Mac OS X as mentioned above. I find this substantial list insufficiently ambitious, even woefully inadequate. While some of the materials certainly assume versions of utilities typically distributed with Linux-based systems rather than BSD Unix systems (consider GNU cat vs. BSD cat, for instance), I find this an indispensable reference even for my current operating system of choice, FreeBSD -- which is not a Linux-based system at all.

Major subject areas covered include:

  • The Basics of Linux and Mac OS X Systems -- Much more comprehensive than it sounds, it touches on the history of Unix and Linux, why such operating systems are worth using, general characteristics of the system, logging in, setting passwords, finding documentation, and getting information about the system.
  • Utilities -- Even experienced Unix and Linux users may find themselves learning some surprising things from this section, which includes several categories of utility; basic utilities, tools for working with files, the Unix pipeline, some miscellaneous tools that deserve special mention, compression and archive tools, search tools, user and system information tools, and a couple of utilities suitable for simple ad-hoc messaging needs.
  • The Filesystem -- A fairly comprehensive treatment of the topic of dealing with the filesystem, this section covers everything from an explanation of the hierarchical structure of the filesystem to the use of Access Control Lists.
  • The Shell Environment -- The techniques of masterful interactive shell usage are exposed succinctly here.
  • Vim -- This section provides one of the better introductions to using the Vim editor that I have encountered. It guides the user through major aspects of the editor's operation such that, if the user learns everything provided, he or she should have reached a level competence sufficient to make him or her miss its capabilities while using any common GUI editor. At the very least, the user should be well beyond the awkward beginner stage of Vim use long before finishing this whole section.
  • Emacs -- My experience with GNU Emacs is mostly limited to a subset of what this book explains to the reader. It is thoroughly detailed, about fifty pages of head-first introduction to the editor, much like the Vim section that way.
  • Bash -- An entire chapter of about eighty pages is devoted to the Bourne Again Shell, the single most common command shell in the Linux world. In fewer than ten pages, this chapter has already introduced the reader to shell scripting in bash. By the end of the chapter, it has gotten as far as writing one's own functions, handling command line options, and parsing the command line.
  • TCSH -- Surprisingly, the book does not stop with bash. Another entire chapter is devoted to tcsh, probably the most common default shell on Unix-like systems that do not use use a Linux kernel, apart from the original Bourne Shell itself (aka "sh").
  • Shell Scripting -- A more serious and in-depth discussion of shell scripting than the relatively minor (for this book, at least) explanations in the bash and tcsh chapters, this section goes so far as to address recursion. It focuses on bash for this subject.
  • Perl -- The Perl programming language, the favorite scripting tool of legions of Unix users, also gets its own chapter. While this chapter is no substitute for a good Perl book like Learning Perl, it offers a primer on the language that should get the reader to the point where he or she can write actually useful scripts within its roughly fifty pages.
  • Awk -- Just in case you had not learned enough about admin and user scripting on Unix-like systems, the awk utility's scripting language is also introduced.
  • Sed -- Yes, really. Where editors and command line utilities meet, we find sed (the Stream Editor). The treatment of this editor places the reader in serious jeopardy of actually learning to make practical use of this arcane tool.
  • Rsync -- The rsync program has become the Swiss army knife of backups on Unix-like systems.
  • Command Reference -- A huge command reference is included in the book, just before the appendices.
  • Regular Expressions -- The first appendix pays special attention to the use of regular expressions.
  • Help -- The second appendix starts with some advice for problem solving; proceeds through Websites, mailing lists, and standard documentation; and winds up explaining how to specify a terminal type, some of the details of different terminal types, and why it matters.
  • Updating -- This is the one place in the book where it gets notably specific to particular Linux distributions. The third appendix is about how to keep a system up to date using tools such as Fedora's YUM, Debian's APT, and even BitTorrent.
  • Mac OS X -- A slew of additional information particular to Mac OS X is available in the fourth and final appendix.
  • The end of the book provides a fifty page glossary, a file tree index, a utility index, and finally the book's main index, which has been reorganized and updated to make using the book as a reference even easier than in the first edition.

The Bad News

  • BSD Unix vs. GNU tools -- There is little coverage of BSD Unix core utilities, with a general assumption that the GNU core utilities will be used. This should come as no surprise once one notices the word "Linux" in large letters on the cover. In the midst of reading the wealth of knowledge imparted by the book that is transferable to commercial and BSD Unix systems, however, stumbling across brief mentions of how utilities work can be jarring when using versions of the tools that are in some respects incompatible with the GNU versions.
  • Info Pages -- The GNU project's hideous, usability-impaired documentation software is frankly an abomination, overcomplicating the task of finding out information about a particular piece of software. It is obviously being pushed by its developers as a replacement for manpages, despite the fact the usability of the info utility is so poor as to appear utterly devoid of value beside manpages. Despite this, Sobell insists on referring the reader to info pages rather than manpages at times throughout the book.
  • HUGE -- This is no pocket book. Do not expect to comfortably lug it around with you everywhere for a little casual reading from time to time.

The flaws in the book are so minor as to be negligible, generally speaking. As the second-best book to act as a reference for BSD Unix users and administrators (after the FreeBSD Handbook) despite the fact it was written for Linux-based systems, it should be obvious that it goes above and beyond the requirements of fulfilling the promise made by its title. Still, there is no denying that the very minor expansion of content necessary to address differences between BSD and GNU utilities, and choosing to recommend more portable and usable documentation tools (i.e., manpages) as preferable to, or at least more widely available than, info pages, would offer a distinct improvement. To get something a bit easier to carry, it might be worthwhile to consider digital formats on devices you tend to carry around with you anyway -- like a netbook.

The final word

Every Unix or Linux user and administrator class at any school offering technical subjects should use this book, or one like it (if such a beast exists), as its primary textbook. Software developers for Unix-like systems can benefit tremendously from A Practical Guide to Linux Commands, Editors, and Shell Programming as well. If you are studying Linux-based systems in particular, or Unix-like systems in general, or even if you just use them regularly, it is a very good book to have within arm's reach.

With more than a thousand pages of densely packed, clearly presented information, this tome's cover price of about fifty dollars is so reasonable it almost seems like a printing error.

About

Chad Perrin is an IT consultant, developer, and freelance professional writer. He holds both Microsoft and CompTIA certifications and is a graduate of two IT industry trade schools.

18 comments
AstroCreep
AstroCreep

Chad, I enjoy reading your articles/blogs; I find most of them to be thoughtful and interesting. I was excited to read this one when I saw the link "The best Linux book available". I am essentially a Linux virgin; I've gotten my hands dirty with SSH to reboot an errant ESX server and make some simple configuration changes on ESX servers and a few "Appliances" at my work, but that's really about the extent of my knowledge of the *nix systems. So you really think that this book would be good for a veritable Linux newbie like me?

Bob-El
Bob-El

Get a Kindle if you think this book is too thick. Amazon offers a Kindle edition which will make it easier to handle and search through.

sidhymes
sidhymes

I wholeheartedly agree with your review - I've used the 1st edition for years. Bottom line: is there enough new material in the new edition to justify buying the new volume?

seanferd
seanferd

I must have run across the title and the author's name before, but I've not read any such comprehensive review, nor bought/borrowed a copy. The FreeBSD Handbook is rather well done, as you note. Possibly the best OS reference I've ever found. Fairly comprehensive, accessible, and freely available. Can't beat that with a stick.

pgit
pgit

...that you, Chad, have sold their book to me. BTW this is one of the most (if not THE most) comprehensive book reviews I've ever read. I would consider buying a kindle or what have you, in order to have this material in such a researchable and more portable format. You might have sold me an ebook reader as well.

lastchip
lastchip

After that review, I could do nothing more but order one! Hopefully, it will arrive later this week. The problem's going to be, finding time to read it. War and Peace for Linux! Edited for grammatical error.

rssutor
rssutor

Obviously the Kindle version is "lighter"? Do you have any insight on how usable it is? Thanks. Bob

lastchip
lastchip

He knows what he's talking about. Around 10 years ago, I started "playing" with Linux - Red Hat at the time and found it usable, but there were many problems. You really had to be a true geek to get anything out of the very ordinary to work and frankly, it was beyond my capabilities at that time. Fast forward to around 3 years ago and I took another look. Encouraged by Chad (apotheon) and Jaqui who offered really useful advice through these pages, I revisited Linux, which had been transformed in that time to something that was very usable and for me, was an acceptable replacement for Windows. Move on another 3 years to now, and the system has been transformed yet again and offers instant usability for almost anyone, except perhaps hard core gamers. So what's this got to do with the book? Well, in that time, I've obviously spent time learning how the basics of Linux work, just like I learned Windows when I first used a computer. But as with all computer related knowledge, there is still mountains of stuff I don't know, and it looks as though this book is going to fill many of those gaps. Let me put it this way. recently, I've been moving everyone I can onto the Linux platform. This includes commercial operations as well as private. I don't do that lightly, but so far, everyone has been both surprised and delighted. My motto in life has been "listen and learn". It's done well for me and it'll do just as well for you. Don't be frightened of it, or put yourself down. In just a little time, you'll wonder what all the fuss was about. Good luck.

apotheon
apotheon

> So you really think that this book would be good for a veritable Linux newbie like me? I think this is one of the best books you could possibly get to get your hands into Unix and Linux-based system administration. It won't teach you much about any particular distribution, about how to get around in GNOME, or about installing any particular distribution on your hard drive, but it is an excellent (and that's putting it mildly) introduction to the power of Unix and Linux-based systems at the command line interface.

apotheon
apotheon

Unless you want the MacOS X material, there may not be enough new material to make it worth buying a whole new book. I'd suggest looking at a copy in the store to judge for yourself, though.

apotheon
apotheon

You might want to consider a Barnes & Noble Nook. The Kindle tends to be fairly infested with DRM, including incidents of people getting books retroactively deleted from their Kindles at the behest of publishers who've changed their minds about the ebook market. The biggest ebook reader name that isn't associated with an online bookstore is probably Sony, and we should all know by now that Sony can't be trusted to refrain from pushing people in front of buses when it goes for a walk in the city, so stay away from those devices. For my purposes, the technology for ebook readers is not quite there yet. I don't want to spend $150+ on a device that does nothing but store books for me to read when it does such a poor job of handling some of the books I'd want to carry around with me in the device (anything involving charts, tables, and lots of images -- i.e., RPG rulebooks -- tends to be problematic on ebook readers such as the Kindle, Nook, et cetera). Your mileage may vary, of course. From what I know, these devices should work fine with A Practical Guide to Linux Commands, Editors, and Shell Programming (We need a pronounceable abbreviation. Is APraGLinCESP still too long?), though I haven't tried it out so I don't really know for sure. edit: Wait, I've got it! A Practical Guide to Linux Commands, Editors, and Shell Programming becomes Pr'inCES, pronounced "princess". What do you think?

apotheon
apotheon

> War and Peace for Linux! . . . but more fun!

apotheon
apotheon

I don't own a Kindle. I can't help you there.

pgit
pgit

PrinCES works for me... war and peace or even "the king james" fit as well. I will look into a nook. I recall reading that you can root it or the like and make a basic tablet out of it.

lastchip
lastchip

I've just read the first 32 pages and that's just the preface!! It is an awesome volume.

apotheon
apotheon

Actually, I'd be afraid it would get mistaken for some other Practical Guide. The same author has written a couple other books whose titles start with "A Practical Guide" as well, including stuff like A Practical Guide to Fedora and Red Hat Enterprise Linux and A Practical Guide to Ubuntu Linux. He's also got one for MacOS X, and something called A Practical Guide to the UNIX System, plus the slightly differently titled UNIX System V: A Practical Guide. Sobell has probably written other Practical Guides that don't come immediately to mind, too -- and that's all just one author.

apotheon
apotheon

I actually like War and Peace as a euphemistic name for the book. I think King James should probably be reserved for the venerable Unix Systems Administration Handbook, though it's also amusing to call that one USAH (pronounced a bit like "user" with a Massachusetts accent). I've read that Nooks can be turned into more generalized Android devices, though I haven't seen such a rooted Nook personally.

Editor's Picks