Linux Introduction
Total Page:16
File Type:pdf, Size:1020Kb
LINUX INTRODUCTION Until recently, running Unix meant investing in a powerful workstation that cost megabucks. Linux changes all that, because it's a complete version of the Unix operating system (software that controls the basic functions of the personal computer) that runs on ordinary personal com- puters. The added fact that it's freely available and "open source" makes it all the more attractive. Linux is perfect for people who want to operate their own low-cost Internet servers, and it's ro- bust enough to satisfy the needs of many Internet service providers. Linux is a multiuser and multitasking environment, and it can access huge amounts of me mory (gigabytes) and huge amounts of disk storage space (terabytes). Linux offers virtually everything that Windows has been promising for years and may not deliver in a truly stable form for some time to come. Don't make the mistake of assuming that Linux is some kind of watered-down or underpowered Unix for the masses. Linux is Unix. POSIX certification (compliance with the industry stan- dards for Unix) makes it official that Linux can do everything that a Unix system is supposed to do. The only difference is that Linux works on a personal computer, whereas other versions of Unix run on larger workstations or mainframes. Linux is also being taken very seriously by the computer industry, with new Linux-compatible versions of popular software packages being announced every month. The Apache Web server software running on Linux platforms powers about half of all Web sites today. Even more tel- ling, Microsoft considers Linux a major threat to its Windows empire. What Is Linux? In the early 90s, a geek named Linus Torvalds at the University of Helsinki in Finland thought it would be fun to write a Unix kernel from scratch. He called it Linux, and it was cool but pretty much useless without all the utility programs needed to make it a complete operating system. At the same time, Richard Stallman and his pals at the Free Software Foundation were writing a bunch of freeware Unix utilities collectively known as the GNU Project. It was cool but pretty much useless without a kernel to make it a complete operating system. Fortunately, the two par- ties decided to collaborate. News of Linux spread quickly over the Internet, and many other Unix programmers joined the effort to enhance it. What we now know as Linux is a combination of Torvald's Linux kernel, the GNU Project software, and some other nifty software bit and pieces developed by pro- grammers from all around the world. Today Linux is a complete and reliable implementation of the Unix operating system, with the following notable features: . 32-bit operation (it uses all the speed and power of your CPU, unlike 16-bit DOS systems) 0. Virtual memory (it can use all of your system's RAM; there's no 640K memory limit) 0. Full support for X Windows (Unix's standard graphical user interface) 0. TCP/IP networking support (allowing connection to the Internet) 0. GNU software support (including a huge amount of free Unix software from the GNU Pro- ject) Note: GNU is one of those recursive acronyms that computer scientists love; it stands for GNU's Not Unix. The GNU Project is an effort sponsored by the Free Software Foundation to provide freely available Unix software. See http://www.gnu.org for related information. Linux was written totally from scratch without using any of the original AT&T UNIX code. (Throughout this site, UNIX refers to the original trademarked UNIX project invented by AT&T. The term Unix is used here as a generic term for other variants of the operating system.) Because of that (and because the author is a nice guy), Linux is free. You can obtain the source code, modify, sell or give away the software so long as you provide full source code and don't impose any restrictions on what others do with it. Previous Lesson: Who is Doctor Bob? Next Lesson: History of Unix Mommy, Where Did Unix Come From? Sometime in the mid 1960s, a bunch of geeks at AT&T's Bell Labs decided it would be fun to create a new operating system called Multics. (This was no small task, because computers at the time were about the size of a football field and two stories high.) Multics fizzled in 1969 when Bell cut the cord, but some of the geeks continued work on what became known as UNIX; and it became wildly popular inside AT&T. Since AT&T was not allowed to sell computer software at the time, it gave away UNIX (com- plete with source code) to any educational institution. AT&T produced new versions of UNIX called System III and System V in the early 1980s, but all the while, geeks at the University of California at Berkeley and other places were busy hacking away on their own versions of Unix based on the AT&T code. Some cross-pollination did occur, but there are still significant diffe- rences between the Berkeley (commonly called BSD Unix) and AT&T flavors. In the early 1990s, AT&T sold UNIX to Novell, which was bought by Digital Equipment Corporation, which sold it to SCO (Santa Cruz Operation), which markets it as UNIXWare. Today, there are now lots of Unix variants sold or given away by many different companies and universities. While these various flavors can make it difficult to write portable software, efforts to standardize Unix (two of the more notable ones being POSIX and COSE) offer hope for greater compatibility in the future. Like any operating system, Unix has some cryptic commands and less-than-intuitive aspects. (Three of the most important Unix commands have the peculiar names cat, grep, and awk .) Either serious hallucinogens or a warped sense of humor came into play at some point in the creation of Unix. I don't let this bother me, though, taking comfort in my favorite platitude: "Unix was written by geeks on drugs." Seriously, though, Unix is really no more difficult to learn than DOS or Windows--it's just different. Previous Lesson: What is Linux? Next Lesson: Operating Systems Uh, What's an Operating System? For a computer to do anything useful, it needs both application software (programs you use) and an operating system (programs the computer uses). The operating system sits between the physical hardware that makes up a computer (the monitor, keyboard, CPU, hard drive, and so forth) and the end-user software that people use to process documents, play games, and all that good stuff. My brother Tom and I are both into computers. We're computer programmers by trade, but I'm quick to point out that we produce very different kinds of software. The difference, as I like to explain it, is this: I write software for people (application software), and Tom writes software for computers (operating system software). We commonly think of the CPU as the brain of a computer, but in reality, it can't do much besi- des crunch numbers and move data around in the computer's memory. The job of the operating system (OS) is twofold: . To work with computer hardware to process user requests by 0. interpreting keystrokes from the keyboard, 0. displaying text and images on the screen, 0. storing files on the hard disk, 0. sending documents to a printer, 0. communicating over a modem. 0. To manage the application software's use of memory (RAM) and processor time. If you've used a multitasking environment like Windows or a multiuser mainframe system, you've seen the concept of "time-slicing" in action. While your computer has only one CPU, which can do only one thing at a time, the OS can make it seem like several people or programs are using the CPU simultaneously. Similarly, even though the real memory (RAM) is shared by all running applications, the OS can make it seem like you have it all at your disposal, all the time, by sharing it between applications--using a technique called paging. The OS time-slices by giving one user or application exclusive use of the hardware for a brief instant, and then doing the same for the next user or application. On systems with adequate hor- sepower, this approach works so that you never even know about that little game of round-robin going on behind the scenes. On a wimpy computer or a mainframe with too many users, it's toe- tappin' time for everybody. Previous Lesson: History of UnixNext Lesson: What's Next? LINUX BASICS What Is the Linux Shell? To use Linux--or any Unix-like system, for that matter--you need to know a few things about shells. A shell is a program that acts as an intermediary between you and the guts of the opera- ting system. In a DOS environment, command.com acts as your shell. Linux shells have more interesting names (like bash, pdksh, and tcsh), but they do pretty much the same thing. In addi- tion to translating your commands into something the kernel can understand and act upon, the shell adds some important functions that the base operating system doesn't supply. Using a Linux shell means working with a command line, which is much like working from a DOS prompt. Modern version of Linux come with graphical user interface (GUI) but some Linux tasks can only be done from the command line. The knowledge of how Linux works that you'll gain in this section will provide the foundation you need to use Linux successfully and efficiently.