“What is UNIX?” UNIX is UNIX, right? Not entirely. UNIX has been evolving feverishly for close to 30 years, sort of like bacteria in a cesspool — only not as attractive. As a result, many different varieties of UNIX have existed along the way. Although they all share numerous characteristics, they differ (we bet this doesn’t surprise you) just enough that even experienced users are tripped up by the differences between versions.
Indulge us while we tell a historical parable. Imagine that UNIX is a kind of automobile rather than a computer system. In the early days, every UNIX system was distributed with a complete set of source code and develop-ment tools. If UNIX had been a car, this distribution method would have been the same as every car’s being supplied with a complete set of blueprints, wrenches, arc-welders, and other car-building tools. Now imagine that nearly all these cars were sold to engineering schools. You may expect that the students would get to work on their cars and that soon no two cars would be the same. That’s pretty much what happened to UNIX. Bell Labs released the earliest editions of UNIX only to colleges and universities. (Because Bell Labs was The Phone Company at that time, it wasn’t supposed to be in the software business.) From that seed, a variety of more-or- less scruffy mutants sprang up, and different people modified and extended different versions of UNIX.
Although about 75 percent of the important stuff is the same on all UNIX systems, knowing which kind of UNIX you’re using helps, for two reasons. First, you can tell which of several alternatives applies to you. Second, you can impress your friends by saying things like “HP-UX is a pretty good implementation of BSD, although it’s not as feature-full as Solaris.” It doesn’t matter whether you know what it means — your friends will be amazed and speechless.
Linux Throughout this book, we note when we discuss a command or feature that differs among the major versions of UNIX. And when we talk about the popular Linux system, you see our cute Linux icon in the margin. We don’t waste your time with a family tree of UNIX systems. The following sections describe the most common kinds.
The two main versions of UNIX are BSD UNIX and System V. Although they differ in lots of little ways, the easiest way to tell which one you’re using is to see how you print something. If the printing command is lp , you have System V; if it’s lpr , you have BSD. (If the command is print , you cannot be using UNIX; nothing in UNIX is that easy.) Here are the major types of UNIX you’re likely to run into:
Berkeley UNIX: One of the schools that received an early copy of UNIX was the University of California at Berkeley. Because no student’s career was complete without adding a small feature to Berkeley UNIX, you can still see on every part of BSD UNIX the greasy fingerprints of a generation of students, particularly a guy named Bill, about whom you hear more later.
The Berkeley people made official Berkeley Software Distributions of their code (named BSD UNIX) and gave numbers to its versions. The final and most widely used version of BSD UNIX is Version 4.4. Berkeley graduates fanned out across the country, working for and even starting new companies that sell descendants of BSD UNIX, including Sun Microsystems (which markets Solaris), Hewlett-Packard (HP-UX), and IBM (AIX). Most workstations run some version of BSD UNIX.
Post-Berkeley BSDs: Shortly before 4.4BSD came out, the folks at Berkeley realized that they had made so many changes to BSD over the years that practically none of the original Bell Labs code was left. Several groups quickly rewrote the missing 1 percent, adapted the BSD code for 386 and newer PC-compatible machines, and made all the code available over the Internet. Three projects (called FreeBSD, OpenBSD, and NetBSD) continued to improve and update the freely available BSD, and a company called Berkeley Software Design, now part of Wind River Systems, offers a commercially supported version of BSD/OS. System V: Meanwhile, back at The Phone Company, legions of programmers were making different changes to UNIX. They gave their versions of UNIX Roman numerals — which are classier than plain ol’ digits. Their current version of UNIX is known as System V. The many subversions of System V are known as System V Release 1 (SVR1) and SVR2, SVR3, and SVR4. Most non-workstation versions of UNIX are based on System V or, occasionally, its predecessor, System III. (What happened to System IV? Not ready for prime time, we guess.) Sun Microsystems, from the BSD camp, and AT&T, of the System V camp, decided to bury the hatchet and combine all the features of BSD and System V into the final incarnation of System V, SVR4. SVR4 has so many goodies that it’s only slightly smaller than a blimp. If your system runs SVR4 or its descendants, you have to pay attention to our hints about both BSD and System V. The last version of SVR4 was SVR4.4. (Where do they get these numbers?) System V was eventually sold to Novell (the NetWare people), which retitled it UNIXWare. Novell eventually sold it to a Microsoft affiliate called the Santa Cruz Operation (better known as SCO), which retitled it UnixWare (don’t ask).
Tip Helpful advice to Sun users: Although Sun changed the name of its software from SunOS to Solaris, it didn’t change the way the software worked. If you use Solaris 1.0, follow the instructions for BSD UNIX. Because Solaris 2.0 is based on SVR4, however, you have to worry about both BSD and System V. Is this stuff clear? We’re still confused about it.
OSF/1: When System V and BSD UNIX merged to form SVR4, many UNIX vendors were concerned that, with only one version of UNIX, the market confusion would be insufficient. They started the Open Software Foundation, which makes yet another kind of UNIX: OSF/1. Although OSF/1 is mostly BSD, it is also a goulash of some System V and many other miscellaneous eyes of newts and toes of frogs.
OSF/1 has largely disappeared; if you use OSF/1, however, pay attention to the BSD advice in this book, and you will be okay.
Linux Linux: Without a doubt, the most surprising UNIX development in recent years has been the appearance — seemingly from nowhere (but actually from Finland) — of Linux, a rather nice, freely available version of UNIX. Linux is such a big deal that we devote an entire chapter to it (the next one, in fact). Chapter 14 also has stuff about Linux for those brave souls who run their own Linux systems.
Linux resembles SVR4 as much as it resembles any other version of UNIX.
In case your system administrator is considering making an ill-advised switch from UNIX servers to Windows servers, here are a few points you should try to work in during your next conversation at the company water cooler.
Windows servers tend to go down — stop working properly for one reason or another — fairly regularly. UNIX servers, on the other hand, tend to work perfectly for months on end. Running your company’s phone sales department on a Windows server means running the risk of cutting off all your callers until you can get your server to reboot, or recover from one of its little episodes.
According to various independent reports, Windows chronically has more security bugs (problems with the way the system behaves) than UNIX. Windows simply doesn’t have the built-in security and permissions features that UNIX has always had.
As far as processing power goes, Windows can’t hold a candle to UNIX. Windows servers now have a four-processor limit, although UNIX machines can handle many, many more. UNIX can handle larger files, and its architecture provides as much as 4 billion times more data space than Windows (yup, we said billion). In practice, this statement means that you have to replace each of your UNIX machines with multiple Windows machines to maintain the same amount of computing power.
Which brings us to the question of cost. Although individual Windows servers may be cheaper than individual UNIX servers (although that’s less true now that the hardware they run on is the same), the apparent price advantages quickly evaporate when you consider the number of servers you need and the cost of administering and maintaining them, not to mention hidden costs from server downtime and data loss.
We could go on (and if you want to meet us over a couple of beers, we certainly will). Suffice it to say that the Microsoft rumors about the imminent death of UNIX have been greatly exaggerated.
Oh, and by the way, UNIX still leads the way when it comes to serving Web sites. The Apache server, which we discuss in Chapter 20, is still the most widely used Web server in the world today. And it doesn’t cost much. In fact, it’s free.
No tour of UNIX versions is complete without a visit to the Free Software Foundation, in Cambridge, Massachusetts (not to be confused with the OSF, Open Software Foundation, which is about six blocks down the street). The FSF was founded by a brilliant but quirky programmer named Richard Stallman, who came from MIT, where people wrote lots and lots of software and gave it all away. He firmly (some would say fanatically) believes that all software should be free, and he set up the FSF to produce lots of high-quality free software, culminating in a complete, free version of UNIX. Despite quite a bit of initial skepticism, the FSF has raised enough money and been given and lent enough equipment to do just that. The FSF’s project GNU (for GNU’s Not UNIX) has so far produced versions of most of the UNIX user-level software. The best-known and most widely used pieces are the text editor GNU Emacs (which we discuss in Chapter 10), most of the other basic UNIX utilities, and the GNU C compiler (GCC), which is now used on all the free versions of UNIX, including Linux, as well as on a few commercial ones.
The GNU crowd continues to work on new stuff, including its pice de rsistance, the GNU Hurd, a complete working version of the guts of the UNIX system. Early on, fans of free software awaited the GNU Hurd with great eagerness; now that Linux and the freely available BSD versions have arrived, however, their eagerness has abated somewhat. Hurd or no Hurd, GNU Emacs, GCC, and the GNU utilities are here to stay. The FSF says you should call Linux GNU/Linux, because so much GNU software is in Linux, but almost nobody does. (There’s probably more BSD than GNU software in Linux, actually.) What the FSF means by “free” software is a little different from what you may expect: It means freely available, not necessarily available for free. It means that if you can find someone willing to pay you a million bucks for some GNU software, that’s perfectly okay. That person, and anyone else to whom you give or sell GNU software, however, must be free to give or sell it, in turn, to other people without restriction. The intention is that people can make money by supporting and customizing software, not by hoarding it. Although opinions vary about the long-term practicality of this plan, for now the FSF surely has written some popular software, and at least one company, named Cygnus Support, makes a good business supporting it.