Absolute Beginner's Guide to UNIX

Chapter 1 Why Everyone's Desperately Seeking UNIX

The Legend and the Lore

In This Chapter


Learning the Legend

In this chapter, I'll tell you the legend of UNIX: its history, purpose, features, and probable future. After you've read this chapter, you'll know all you need to know to talk and think about UNIX intelligently. You'll know enough, in essence, to understand why people use UNIX and what it's good for. You'll also understand why businesspeople are moving in droves to use UNIX for more and more of their business operations. Perhaps most importantly from your perspective, you'll be able to bluff your way through conversations about UNIX, keeping up even with rocket scientists about general topics in the UNIX community.

Who Uses UNIX?

UNIX is one of the computing world's best-kept secrets. It's like the air: most people, both in and outside of the computer industry, take it for granted. A huge and growing number of American businesses use the computer system, yet few of the customers of these companies (and indeed, many of the people who work at them) have any idea that such an odd-sounding thing is processing their flight reservations (Northwest Airlines), running the retail outlets that they frequent (Wal-Mart and Burlington Coat Factory), and designing the airplanes in which they fly (Boeing, Hughes).


Note:
UNIX-based computer systems create the special effects for many of the world's most popular movies (Disney Studios, Lucas Films, Pixar, Silicon Graphics). Also, at the nation's biggest supercomputer facilities, UNIX is the system that rocket scientists and geneticists use in their daily work, creating the world's next generation of miracles. From analyzing the effects of world population and famine on the environment to understanding how chromosomes work, UNIX is the world's computer workhorse.

Is UNIX Hard to Learn?

UNIX is much friendlier than its name may make it sound. UNIXWorld, a popular magazine for UNIX users, recently did a feature on UNIX in the home--it was a real eye-opener for me. Because UNIX is so easy to learn and to use, an increasing number of families are adopting UNIX as their home operating system. Mom, Dad, and the kids are all hooked into the same UNIX network, which runs on heavy-duty cabling throughout the house. The kids grow up thinking everybody uses UNIX, and they don't find it difficult or complicated. These children are surprised when they discover that some people use computer systems called DOS and Windows.

The kids love UNIX because it has opened up the world to them, not because of any technical merits. They can use it to send electronic mail (also called e-mail) to their friends across the country or around the world. Using UNIX to explore the Internet, they can find other children and adults who share their interests; they love UNIX because it's fun.


Note
The Internet is a series of wires connecting computers around the world. You can think of your cable company as something like the Internet. Your cable company can connect everyone in your city by a series of wires carrying, for example, CNN or the The Weather Channel to every television on the wire (cable). Your television is essentially a one-way receiver. With UNIX, your home computer becomes both a receiver and a sender of messages on the Internet.

WARNING
If you have children, they might be out-computing you! One man told me he was sure he'd spent only a half an hour teaching his daughters UNIX; after that, they taught themselves so well that now they occasionally teach him a thing or two about UNIX. Another man told me his 9-year-old son is so good at using e-mail that he's made many friends he's never seen. The son belongs to many UNIX newsgroups, which are similar to electronic bulletin boards, and is involved in a long-standing baseball simulation with his friends. He sees nothing strange about that, even though his mother told me that because he was the first child to ever participate in the game, the adults had decided to be extra-careful about their language.

For more information about getting UNIX for a home computing system, see the resource list later in this chapter.


The ease with which UNIX can be learned and used is part of what gives it such a bright future, with uses extending from the most esoteric scientific research to the humblest of home projects. UNIX hobbyists have been known to hook up their UNIX computers to run household and outdoor lighting, sprinklers, burglar alarms, and even fish tanks. If you saw the movie Jurassic Park, you may have glimpsed a not-so-distant future use of UNIX: the fictional park's perimeter-fence system and security were controlled by a UNIX operating system.

How Did UNIX Get Its Funny Name?

Perhaps what holds many people back from learning about UNIX is its strange name, which is responsible for a lot of confusion. As a writer for UNIXWorld's Open Computing, I'm used to long pauses when I tell people the name of the magazine for which I write. Every once in a while, I forget how odd the word sounds and how easy it is for other people to confuse it with its homonym, eunuches.

For instance, I recently met an old friend--a bright, aware person--whom I hadn't seen for years. She asked me over lunch what I was up to, and I told her I was a writer for UNIXWorld. After a long pause, she finally said, "Oh my, well, I guess they need their own magazine too, but how did you get into writing about that? "

Actually, there's an interesting history behind the name, and it's not what you might think. In 1969, UNIX was developed by researchers at Bell Laboratories in a project headed by a computer scientist named Ken Thompson. He wanted to provide an easy-to-use alternative to an earlier operating system named Multics. To show that the new system was different from Multics, but designed to solve some of the same types of computer problems, it was named Unics. Eventually, the system's name was changed to UNIX. The name has nothing to do with harem guards; if anything, its name is a testament to the sense of humor (or lack thereof) of the programmers who designed it.


SKIP THIS, IT'S TECHNICAL
In 1957, Bell Laboratories had a need for its computer center to run many short batch jobs. Originally, an operating system called BESYS was created for this need. Shortly afterward, Bell began to use different equipment and decided to join forces with General Electric (GE) and Massachusetts Institute of Technology (MIT). Together, the three created an operating system called Multics. Multics was a general-purpose multiuser and time-sharing operating system. Later, Bell abandoned Multics to pursue yet other endeavors. Dennis Ritchie and Ken Thompson proposed to write another operating system based on Multics. They began to write the new operating system on an old, little-used computer called a Digital Equipment Corporation PDP-7. Thompson wanted many new features in this operating system, including a tree-like file structure, a command interpreter like the shell, and access to various physical devices such as modems, printers, and terminals. Thompson and Ritchie decided to name the new operating system UNIX to distinguish it from Multics. This year, 1994, is the twenty-fifth year that UNIX has been in existence. Happy birthday, UNIX!

Even soon after its creation, UNIX was extremely advanced, incorporating many capabilities that didn't become widely popular until 10-20 years later, an eternity in the computer world. E-mail, for instance, was incorporated directly into UNIX, as were some rudimentary word processing packages. Keep in mind that this was in the 1960s and 1970s, long before Microsoft Mail, cc:Mail, and Davinci were a gleam in any programmer's eye.

What is UNIX?

Programmers will tell you that UNIX is a multiuser, multitasking operating system. "Great," you say, "now I need to learn three new terms, not just one."

Well, let's break them up and put them into human terms. I'll start with the words operating system . If people were computers, our "operating system" would include our central nervous system; the part of us that handles motor coordination, hearing, and vision; the part that processes signals from our digestive system and glands; and the part that coordinates our speech.

To continue the analogy a little further, you may have heard people talking about programs or applications . A program or application is basically a set of instructions to the computer to tell it to perform a set of duties. For instance, your nose itches. Your brain, the "operating system," picks up this annoying little sensation and runs an "application" called "scratch-your-nose" to take care of it. With the direction and assistance of the brain, the "scratch-your-nose" application tells your arm muscle to lift your hand toward your nose. Next, it tells your hand to extend one finger and move it against your nose. The operating system continues to run the "scratch-your-nose" application until it receives a signal that the irritation has stopped. The operating system manages these operations automatically, without much conscious effort, in the human body.

An application depends on an operating system in the same way that the part of you that knows how to scratch an itch or to speak French depends on the parts of your brain that interpret sounds and sensations and that coordinate your muscles to move a hand or make words. Knowledge of how to move a hand or of the meaning of French words and grammar is like the application that runs on UNIX: it performs a complex set of instructions that depends on some basic functions being handled at a much lower level.

In other words, an application or application program does some sophisticated, specialized, high-level activity, whereas an operating system handles the general, low-level activities that all computers and computer programs must do to run properly.


NOTE
You have probably used applications without knowing it. For example, many televisions have a program that is activated by the remote control. To turn the channel, you press a button that activates the change-channel program in your television's "operating system." Some televisions have extensive programs for picture-in-picture and surround-sound decoding.

UNIX is a multiuser operating system. The term multiuser means exactly what it suggests: more than one user can use the operating system at the same time. Just as your neighborhood fast-food restaurant is built with multiple chairs and tables to serve many customers at once, UNIX is built on the assumption that many people may be using the same computing resources at the same time. For example, UNIX can have multiple terminals (keyboards with attached video monitors). Not all computer operating systems are like this. DOS--the most common operating system for personal computers--is not designed to allow several people, working on different but connected terminals, to use a single, common computer. Although you can buy products to modify DOS and give it some limited multiuser capabilities, DOS itself is not a multiuser operating system. Because UNIX is designed with the assumption that many people will use it to share their computing resources, certain features--about which you will learn more later--are universally available on UNIX systems.

Finally, UNIX is a multitasking operating system. Multitasking is, roughly speaking, what happens when a fast-food employee works alternately on filling two different orders at the same time, getting a drink for A while waiting for a burger for B, then wrapping the burger for B while waiting for fries for A. Likewise, UNIX manages its resources so that it handles several orders at the same time: when you're working on a UNIX system, you can run multiple programs at once. In Chapter 2, "UNIX Interfaces: Motif and Open Look," you will learn about graphical user interfaces, known as GUIs. With GUIs, you can have several views, known as windows , to the UNIX operating system. With these different windows, you can run a word processor in one while running a calculator in another. This multitasking capability is part of what has made UNIX so popular.

The other consequence of the multitasking capability of UNIX is that a particular computing unit need not sit idle simply because one user has left the terminal and gone home for the evening. The computer can turn greater attention, figuratively speaking, to the "orders" being submitted by other users who are working at other terminals. This feature of UNIX is important because computers are expensive; the less wasted time and more work done, the more productive a single machine can be.


Clue:
Computers are so fast that, unless a machine is being used by several people, it's spending more time idling than working on problems.

Furthermore, the multitasking capability of UNIX means that it is good at harnessing the brains of many different computers. Many companies have turned to UNIX to help them run their businesses, because UNIX lets them get more bang for the buck.

From DOS to UNIX: Making the Transition

I have mentioned DOS several times. As you may already know, many people use an operating system called MS-DOS, an abbreviation of Microsoft Disk Operating System. To glimpse some of the differences between DOS and UNIX, look at the following code fragment. (If this is your first encounter with either operating system, don't worry; you can skip over this section.)

This is an example of what would appear on my screen when I start DOS, change to a new directory, list the files in that directory, look at a particular file called ROADTRIP, copy the file into a new file called ROADTRIP.SAV, delete the old file, and, finally, look in the directory again to see that the new file has been saved. The DOS commands are shown here in bold:

Microsoft(R) MS-DOS(R) Version 6.22
             (C)Copyright Microsoft Corp 1981-1991.

C:\>cd tmp

C:\TMP>dir

 Volume in drive C is VOL_DSK
 Directory of C:\TMP

.            <DIR>     06-09-93   1:14a
..           <DIR>     06-09-93   1:14a
ROADTRIP           108 05-03-94   1:20p
        3 file(s)        108 bytes
                   137469952 bytes free

C:\TMP>type roadtrip
A journey of a thousand miles begins, hopefully, with an empty
bladder and all the appliances turned off.

C:\TMP>copy roadtrip roadtrip.sav
        1 file(s) copied

C:\TMP>del roadtrip

C:\TMP>dir/w

 Volume in drive C is VOL_DSK
 Directory of C:\TMP

[.]             [..]            ROADTRIP.SAV
        3 file(s)        108 bytes
                   137469952 bytes free
If, however, I would use the UNIX operating system to accomplish the same tasks, I would see the following output and would enter the UNIX commands marked in bold:
UNIX(r) System V Release 4.0 (excelsior-bb)

login: lisas 
Password:
Last login: Wed Feb  2 06:55:53 from enterprise-bb
Sun Microsystems Inc.   SunOS 5.3       Generic September 1993
you have mail
$ cd /tmp 
$ ls -l 
total 1
-rw-r--r--   1 lisas    vip          106 Feb 16 13:20 roadtrip
$ cat roadtrip 
A journey of a thousand miles begins, hopefully, with an empty
bladder and all the appliances turned off.
$ cp roadtrip roadtrip.save 
$ rm roadtrip 
$ ls 
roadtrip.save
If you are used to working with DOS, this may seem strange at first, but you'll quickly see the advantages of UNIX.

The Economics of UNIX

The most important reason UNIX has become so popular is its universality. For years, AT&T was forbidden by law from profiting from the sale of UNIX, so it licensed the operating system to many computer companies who put the operating system on their computers and, in turn, sold the computers to companies and individuals. Over the years, UNIX has been licensed for use on many kinds computers, and therefore many features of UNIX are much alike on many different brands of computers. This means that people who make their livings working with computers can learn UNIX, and they don't have to relearn everything later when they have to work on a different brand of computer.

It may seem obvious that people shouldn't have to be retrained every time their company buys a new computer. Throughout the years, many computer manufacturers--such as IBM and Digital Equipment Corporation (DEC)--deliberately put their own proprietary operating systems on their products so that, once companies had decided to buy computers from one of these vendors, those companies would be afraid to ever buy computers made by anyone else, given the difficulty and expense of retraining employees for a new operating system. They would also have to rewrite all of their computer programs if they changed operating systems. Once a company committed to a particular operating system--from IBM, for example--that company was stuck with buying computers from IBM for years and paying monopoly prices for the privilege.

Moreover, the manufacturers often came out with newer, faster machines that would run only a newer, proprietary operating system put out by the same manufacturer. This meant massive disruption for many companies who had to rewrite their computer programs and retrain all of their people every few years. It was as if every time companies wanted to buy new computers, they first had to decide whether they wanted to learn a new computer operating system that was as different from their old one as Latin is from Russian.


NOTE
Businesspeople often had to say that they were an IBM shop or a DEC shop, because once they had bought computers from these companies, they had essentially committed to one of these computer manufacturers forever. (IBM and DEC weren't the only companies who tried to lock customers in, but they were by far the most successful.) Computer buyers, therefore, used to joke about having sold their souls to IBM and DEC.

With UNIX, the situation was different. People could buy computers that ran UNIX from many different manufacturers, so they weren't locked into buying one brand of computer. That made UNIX increasingly popular with people who didn't want to pay monopoly prices for their hardware. Most of these people felt empowered by UNIX, because it meant they had a choice of which hardware to buy.

Because UNIX was judged by so many to lead to lower computing costs, the U.S. government mandated that all of the computers it bought should be capable of running UNIX. Thus, all of the government bids in the 1990s and the late 1980s have had to discuss the UNIX capabilities of the computers to be bought.


NOTE
At many colleges and universities, the departments of computer science and mathematics have adopted UNIX as their operating system. AT&T was generous in providing to universities the source code for UNIX. This has given universities two benefits. First, they had an operating system that could be modified for their purposes. Secondly, they could give UNIX to students to learn how to write and modify operating systems.

The Evolution of Different Types of UNIX

Although UNIX systems today remain remarkably similar, almost every hardware manufacturer made at least a few changes to the basic UNIX they licensed from AT&T. They changed it, in most cases, to run faster on their computers (so they could sell more computers) or to do something unique that was important to their own customers. As a result, each UNIX is a little different from all of the others, even though there is a lot of commonality among them. In essence, it's as if each UNIX were a different dialect of the same language. If you stick to the central core of the language, you'll probably understand everything just fine. If you want to use all of the slang of each dialect, you'll have a lot more to learn every time you switch dialects.

AT&T's original UNIX has gone through a number of revisions over the years. Perhaps the most popular version is called System V, Release 4. This is often abbreviated SVR4, pronounced "Ess Vee Arr Four." Many of today's most popular UNIX computers claim this version as their heritage: Hewlett-Packard Company's HP-UX, IBM's AIX, the Santa Cruz Operation's Xenix and UNIX, and Silicon Graphics's IRIX.

Another company, Berkeley Software Distribution (BSD), has made some major changes and improvements to UNIX, and some very successful computer companies have used versions of BSD's UNIX on their computers and workstations. In particular, Sun Microsystems Computer Corporation, the first successful UNIX workstation vendor, used BSD as the basis for its popular SunOS. More recently, Sun has introduced a new version of UNIX--Solaris 2.3, which complies with the SVR4 standard while retaining many of the BSD extensions.

In 1989, concerned over an increasingly chummy relationship between Sun and AT&T, several computer companies banded together to create their own UNIX consortium, the Open Software Foundation (OSF), and their own variety of UNIX. The resulting UNIX, called OSF/1, is chiefly used by DEC in its Alpha line of workstations.

In early 1993, Novell, a Utah-based computer communications company, bought UNIX and the part of AT&T that was responsible for updating and selling it, UNIX Systems Laboratories, for hundreds of millions. In autumn of 1993, less than a year later, the company announced that it would be giving the source code to X\Open, a non-profit company that would be responsible for improving UNIX and licensing it to others.

Also in the 1990s, Microsoft Corporation, the huge software seller and operating system vendor, developed an operating system based on UNIX. This operating system, called Windows New Technology (Windows NT for short), combines many features that are similar to UNIX with compatibility with Microsoft's popular Windows software. Many people who already have Windows software are very interested in the UNIX-like operating system.

As of this writing, rumors also abound in the user community that some vendors--notably Sun--may come out with yet another version of UNIX that would have another name and would therefore be free from licensing fees. We will have to wait and see.


NOTE
This book covers the basics common to every version of UNIX. Don't worry about whether your system is the right one for this book.

The Future of UNIX

Although nobody is sure what will eventually happen to UNIX, some trends seem to be contributing to its growing popularity. (There are at least 2,000,000 installed computers running UNIX, and many of these computers are used in networked environments, where many people use one computer.) First, the large workhorse computers that big companies use--called mainframes--are wearing out or are otherwise needing to be replaced. For one thing, running mainframes has become increasingly expensive. Mainframe software maintenance, combined with the special room requirements and hardware maintenance, can be very costly. Many companies have decided that small UNIX systems with applications running on several personal computers or workstations are a cost-cutting alternative.


SKIP THIS, IT'S TECHNICAL
The combination of small UNIX systems with applications running on several personal computers has been called client/server technology. This means that the personal computer is used to process information and the server is used to hold the data (a server is a centralized repository for information, such as e-mail and data). The process of making the adjustment to client/server or UNIX technology from the mainframe environment has been termed rightsizing.

UNIX is ideal for managing such networks because UNIX has many advanced communications features built right in--most notably a communications facility called TCP/IP. More and more companies are deciding they need to upgrade their networks to UNIX, making the UNIX operating system increasingly popular.

Finally, there has been growing unwillingness on the part of the people who buy computer systems for corporations (often called Management Information Systems managers, or MIS managers) to stick with the computers of any one computer company. Today's computer networks are increasingly a hodgepodge of computers from IBM, Hewlett-Packard, DEC, Data General, and others. It is common for UNIX to be the glue that holds these networks together. These are called heterogeneous networks .

Where Can You Learn More?

In addition to this book, which will tutor and counsel you as you find your way, there are many other sources of help. Many of these are online, computerized resources; they are covered in later chapters because you must first learn how to access such online sources. There are also many more traditional sources, such as magazines and clubs.

For instance, many magazines can help you understand the general UNIX landscape, as well as give you tutorials in up-to-the-minute, hot topics on the use of UNIX and the Internet. The following sources can help you with this:

UNIXWorld's Open Computing
McGraw Hill, Inc.
1900 O'Farrell St.
San Mateo, CA 94403
415-513-6800
Open Computing is aimed at businesspeople and at explaining UNIX and open systems--a term that loosely means the interconnection of different sorts of computers. The articles are generally written so that people of all levels--from beginner to expert--can follow them and learn something. Often, the articles take a light-hearted approach to UNIX. Particularly interesting to beginners is a "New-to-UNIX" tutorial column and a book review section, as well as very readable sections on industry and product news. The Internet and the Information Superhighway are also covered.
Open Systems Today
CMP Publications
600 Community Dr.
Manhasset, NY 11030-3875
Open Systems Today follows the UNIX industry and the computer business. The tabloid covers product information and industry news. It also contains personality profiles and business stories about prominent people and companies in the UNIX field. It is available free for people who buy a lot of computer equipment.
UNIX Review
600 Harrison St.
San Francisco, CA 94107
800-829-5475

UNIX Review is aimed primarily at programmers, but does contain some interesting industry news and columns. For instance, several literary columns are often extremely enjoyable for their intriguing wordplay, particularly if you have a background in English classics or literature.

In addition to these sources, there are many clubs for people who use UNIX. These usergroups often hold local, regional, and national meetings to discuss UNIX and related computer issues. The largest such national usergroup is called Usenix; if you're interested, you can call the organization for the location and meeting times of your local organizations. These people are usually quite sociable and will let you know that you're not alone in your quest to learn UNIX. The following is the usergroup's address and phone:

Usenix
2560 9th St., Ste. 215 
Berkeley, CA 94710 
510-528-8649

Another area of interest for many people who are learning UNIX is information about UNIX products. All of the previously mentioned magazines carry product news, but there is also a yearly book of all of the UNIX products on the market called the Uniforum Directory. It is put out by Uniforum Inc. and costs several hundred dollars, but if you or your company buys a lot of computing equipment or software, it's probably worth it. To order the book (or look for it in a library), you'll need the following information:

Uniforum Directory
Uniforum
2901 Tasman Dr., Ste. 201 
Santa Clara, CA 94054 
800-255-5620 / 408-986-8840


NOTE
Besides the journals mentioned here, several manufacturers--Sun and IBM (AIX), for example--have magazines dedicated to their particular kind of UNIX. Also, several journals are produced by usergroups that specialize in particular kinds of UNIX.

UNIX and You

The increasing popularity of UNIX is why so many people are learning UNIX for the first time. These novices, like you, are generally unimpressed by many of the more esoteric technical features that intrigued UNIX's earlier audience of programmers, systems analysts, and system administrators. Rather, they are intelligent, creative professionals who want to learn enough to do their work, which usually doesn't include C programming or writing operating systems.
Clue:
Remember the section on applications and programs earlier in this chapter? Well, applications are made of commands that in detail tell the computer what to do. The commands together form what is called a computer programming language. There are many computer programming languages, just as there are many spoken languages--English, Spanish, and German, for example. Each language looks and sounds different, but each can convey the same meaning. Whether I say "Go fetch a pail of water" in English, or "Traiga un balde de agua" in Spanish, or "Gehe einen eimer wasser holen" in German, the meaning is the same. In computer terms, languages such as C, BASIC, and Pascal look different, but each can tell the computer to perform the same task. Dennis Ritchie and Brian Kernighan invented the C language to help finish the UNIX operating system.

As You Move On

This book is for people like you. It is a guide for those who wish to learn enough about UNIX to be productive in their own specialty--management, technical writing, accounting, manufacturing, or drafting--but who don't want an operating system to take over their lives. They also want to know how to use computers effectively for business research and communication, so they need to know how to use the Internet and e-mail to get the information they need from all over the world. Use this book as a roadmap to guide you through the territory. The book can illuminate rough terrain, point out traps and pitfalls, and show you how to triumph and conquer in the Information Age. It will help on your way as you begin your new adventure.
Rewards
Pitfalls