How Linux Works: What Every Superuser Should Know
by Brian Ward
Published by No Starch Press
In the WLUG library

Reviewed by JohnMcPherson


Despite having used Unix and Linux machines for nearly a decade, I still learnt something new from just about every chapter of this book.

Most of the concepts covered in this book are both linux-distribution independent and, more generally, applicable to most unix flavours.

The early chapters give a quick overview of standard command line tools, Processes/redirection, EnvironmentVariables, and so on, moving through to directory structure, FileSystems, devices, the boot/init process, and important configuration files.

The book then moves through more advanced topics (with examples/walkthroughs) that new administrators are going to want to cover; networking protocols/devices, with a strong emphasis on how to connect to an ISP using typical consumer access devices; shell scripting; and compiling applications and kernels from source.

The later chapters in the book cover the configuration various hardware (eg CD Writers,USB,FireWire), Printers, backups, Samba, rsync, Shell startup/environment, and the book finally finishes with a general guide to buying hardware (both for your needs, and how to check for linux compatibility).


  • Despite the book's name, much of the information is applicable to other Unix OSes, not just Linux. Most information was presented in a distro-neutral way.
  • Despite covering many topics, I felt that the ground was adequately covered without going into too much detail.
  • There were lots of nice little tips and hints sprinkled throughout.


  • The chapters on development tools/compiling software/compiling kernel don't seem necessary in such a book.
  • Most of the examples only show things going right - not much help for people trouble-shooting with common errors. (I felt the printing and networking sections in particular could have shown the symptoms of some common problems people might encounter).

I think that most users would get something out of this book, and I would encourage new Linux admins struggling to completely understand how their system works to read this, especially the straight-forward descriptions of setting up printing, and other hardware.

-- JohnMcPherson

Gory Details (chapter by chapter)

Chapter one gives a brief overview of common options to the most standard command line tools (ls, cp, mv, grep, head, tar, and the rest) along with how to use the shell, processes and job control, and file permissions.

One small detail that really nagged me was that ctrl-b and ctrl-f are mentioned for moving the cursor left and right, but no mention of the letters standing for "back" (b) and "forward" (f), which otherwise might just seem like mystic obscure keystrokes to a newbie.

Something I picked up from this chapter: unexported variables (ie that aren't passed on to new processes) are called "shell variables" - I'd never really made a distinction in terminology between exported environment variables and unexported ones.

Chapter 2 covers devices, FileSystems, mounting, etc. There's a nice (but brief) explanation of tty/pts devices, and a good introduction to partitioning, with examples using fdisk. There are also useful hints and examples for checking disk space, being aware of POSIX block sizes on some systems, and useful options for fsck.

Chapter 3 does a good job of demystifying the boot and init process, describing runlevels and init script ordering, and finishing with a section on boot loaders, with an emphasis on GRUB and how to configure it.

Chapter 4 covers all the important /etc files, with information that is more likely to be of use to new users, although the sections on syslog and inittab might be useful for refreshing the memory of more advanced users.

chapter 5 has easy to follow descriptions of PPP and broadband (cable+dsl), with a nice walkthrough of setting up PPP connections, an area which isn't always straight-forward for a newbie. Firewalling (iptables), NAT, and other stuff likely to be of use to someone setting up a small network is described with sample walkthroughs. There is also a section on setting up wireless networking (with command line tools), finishing with a note on wireless security and the need to use secure protocols.

The usefulness of this chapter (from my point of view) is limited by the fact that 1) the PPP section doesn't discuss any common errors or error messages at all, and 2) only PPPoE is covered for DSL users, while almost all DSL in NewZealand uses PPPoA, which isn't even mentioned.

Chapter 6 covers setting up network services inetd, ssh (mentions putty and macssh for non-unix users) as well as good strategies for checking network security (such as using nmap, not using clear text programs like telnet, and "I would usually not rail against a specific program, but Sendmail has an exceptionally long history of exploitation"...).

Choice quote: "RPC is one of those protocols that just doesn't seem to want to die. ... But whenever you think that you've eliminated all need for portmap, something else comes up, such as File Access Montor (FAM) support in GNOME." In my opinion, this chapter had just the right level of detail for a new administrator.

Chapter 7 briefly covers Bourne-shell scripting syntax and basics such as quoting, variables, exit status and conditionals, using examples that will be of assistance to a novice.

This is followed by a quick overview of essential 'glue' utilities (sed, awk, xargs) although this is too light to be of any real assistance, and ends with a wise recommendation to learn perl, python or awk if you need to do anything other than 'manipulating files and commands'.

Chapter 8 introduces users to unix development, starting with a description of what the C compiler does, include paths, and linking against libraries. Overview of make, gdb is glossed over, background on different languages strengths and weaknesses (perl, python and java). This leads into a chapter on compiling software from source. (tar, autoconf, configure, compiler environment variables, patch), and a chapter on how to build the linux kernel (which largely consists of pointing out useful device drivers you should include support for). As I said in my summary, I'm not convinced that the typical linux administrator needs to know all this or know about how the LD_LIBRARY_PATH environment variable affects dynamic loading of libraries, although admittedly it might be useful as a quick reference for a more advanced user, and the lilo and grub setup section has the right level of information compared to their respective man pages.

The latter chapters deal with common hardware, with straight-forward descriptions of configuring cdwriters, usb and firewire devices (with useful hints for ipod owners) as well as some of the software stuff like HotPlug and PCMCIA configuration. My biggest complaint about this (as in earlier sections) would be that the examples only show things going right -- there isn't much help for someone getting any common error messages.

The chapter on printing has a nice introduction, with a brief outline of the different printing systems and postscript, and why you should just use CUPS, followed by a nice description of how the different parts of CUPS interact (PPD files, postscript and foomatic/filters), and how to troubleshoot each step. Even though I've set up and used cups several times in the past, I learned quite a bit from this.

Chapter 13 covers the important task of making backups, although it makes itself somewhat irrelevant to many home and small business users of linux by focusing on tape drives.

Chapters 14 and 15 cover networking from a user point of view (as opposed to the earlier chapters on network setup), going over samba as a server (to share your files and printers) as well as as a client (accessing others' files and printers), and a useful little section on using rsync when communicating with other unix machines.

The last chapter feels a little out of place, but seems quite useful --- a guide on how to choose hardware for your purposes. I can imagine this being very informative for someone who doesn't already know all the jargon or options available --- eg LCD vs CRT display, IDE vs SCSI drives, PostScript printers vs others. And perhaps the most sage piece of advice in the chapter is to not buy hardware based on future upgradeability; plan on replacing motherboard, CPU and RAM together at the same time for price and performance reasons.