Welcome to the World of UNIX
Welcome to my Teach Yourself UNIX in 10 Minutes the chameleon way :). If you’re like most individuals faced with using UNIX for the first time, there are probably a dozen notions you have about what using UNIX will be like—mostly all of them intimidating. People have probably told you that UNIX is difficult to use, that the commands are cryptic, and that the interface is non-intuitive. You’ve almost certainly heard that UNIX is powerful, but that the power comes at the price of a steep learning curve. The thought that learning and using UNIX will be fun and rewarding is probably one of the furthest from your mind. The contents of this book will hopefully change your mind. You will learn how to make use of UNIX’s command line and graphical user interface, and to familiarize yourself with the commands you need to productively use UNIX on a day-to-day basis.
So What is UNIX, Anyway?
UNIX is a powerful multitasking (it can run multiple programs simultaneously) operating system. Having been designed originally as an experimental operating system on which to test OS implementation ideas, UNIX grew from its humble roots to the leading commercial platform for network server and program development.
Because of its roots, many parts of UNIX are implemented in what might be considered “the easiest way possible.” Although this leads to certain inefficiencies in the OS, it also proves to be one of UNIX’s greatest strengths—many of the “easiest way possible” ideas turn out to be great benefits to the user. The easiest way possible tends, for example, to lead to abstraction of where data is stored or how it is accessed. Rather than being concerned where something is located, it’s easier to design a single way of accessing data. Then whenever data needs to be retrieved from some new type of device, you create a piece of software that allows the new data to be accessed through the pre-existing interface.
UNIX is also a multi-user operating system. Unlike some personal-computer implementations of the idea of multiple users, with UNIX, many users can simultaneously use a single machine. From the point of view of each of these users, they are in control of the complete machine. Also, instead of simply hiding your files from other users UNIX actually gives you the capability to deny or allow other users access to your files, making them invisible—and inaccessible to users who are denied access.
One of the interesting things you’ll discover about UNIX after you’ve used it for a while is that many of the more useful utilities and applications are written by, and supported by, other users just like yourself. The power of the UNIX operating system, the ease with which sophisticated commands can be constructed, and UNIX’s powerful programming and networking ties have bred a strong cooperative streak in UNIX users. It is a long-standing tradition that software constructed to solve a problem is made available by its author to the rest of the UNIX community, and this becomes yet another building block for even more sophisticated commands. You might be surprised to find that the most powerful compiler and debuggers available for UNIX are available for free, as are many other useful applications. Although you might be familiar with the idea of shareware from the personal computer world, the idea of UNIX freeware is likely to take you at least slightly by surprise. Much of the UNIX freeware rivals or surpasses commercial software in its elegance, completeness, and—most of all—in the rapidity of response to the report of errors in the software. Unlike singular shareware authors, much UNIX freeware is supported by entire user communities. For example, if you’re using one of the freeware UNIX database systems and discover a bug, it would not be unexpected for one of the hundreds of users who contribute code to that particular project to have your bug fixed—and a new version released in less than a week.
Versions of UNIX
With only a little looking around, you’re likely to notice that there are many different versions (frequently called flavors) of UNIX available, sometimes even coming in multiple flavors from a single vendor. The largest consistent difference you will notice if you use multiple different versions of UNIX is between versions based on AT&T’s System V UNIX and the Berkeley Standard Distribution BSD4.X UNIX. This book has been written to be as general as possible and to not favor any one vendor or implementation. Where variations between command behavior is known to the author it has been noted in the text, but there certainly is the possibility (probability? certainty?—yes, certainty) that there are other variations as well. This book will teach you how to use UNIX’s built-in manuals and help system to find additional information on commands that do not function as described here.
Tip:
If something in an example doesn’t work on your system, don’t be alarmed—check the online manuals or ask other users of your machine. Different versions of UNIX sometimes have slightly different versions of commands—it will be worth your time to learn how things work on your system.
How Do You Use UNIX?
Unless you’re simply using a UNIX machine as a platform for a pre-packaged commercial application, most of your interaction with UNIX is likely to be textual—commands typed at a command-line prompt. Most implementations of UNIX do provide a GUI (graphical user interface); however, even when running the GUI, much of what you are likely to do involves typing commands into terminal windows which are available in the GUI.
Don’t let the fact that you have to use textual commands worry you. Although it’s not as intuitively obvious as dragging and dropping to copy files, the command-line interface is actually one of UNIX’s strengths. Again doing things the easy way, UNIX commands tend to be simple commands that do one simple thing. It is the capability to combine many of these simple commands together to make much more complex commands—commands suited to do almost anything you can imagine—which makes UNIX truly powerful.
On some versions of UNIX you might also find useful utilities built-in as part of the GUI. Some of these make the GUI almost as sophisticated as the personal computer interfaces with which you might be familiar. You will be introduced to KDE (K Desktop Environment), one particular flavor of such an interface, in this book. KDE was chosen as a representative sample for this book because it is available on a wide range of UNIX flavors, because it is one of the more sophisticated examples, and because it is a wonderful example of a free product supported by its users.
Word of Caution:
As tempting as it might be, you are cautioned not to become entirely dependent on GUI utilities even if you have a GUI product with the sophistication and convenience of KDE. Although the GUI utilities are often faster and much easier than using the command line, it is rare for a GUI version of a command to have the same power and extensibility that the command line version will have. If you rely only on the GUI, you will be limiting yourself and not making use of the full power you have at your disposal.
How to Use This Book
This book is designed as a series of lessons. The earlier lessons give you an overview of how to start using UNIX, how to get help, and a bit of the UNIX philosophy to help you to understand why some things have been done in the way that they have. The lessons progress through examples of the sorts of commands you’ll need to use the very first time you sit down at the machine, through more advanced topics. For the early topics you will find line-by-line instructions on the use of most commands, with examples that you can follow at your own machine. As the topics become more advanced, the information becomes more of an overview of the functionality of the commands. When you’ve reached that point, don’t hesitate to use UNIX’s built-in manuals. With the immense number of commands and diverse functionality available to the UNIX user, it is impossible to cover even a small fraction of the commands in-depth in a book this size. Instead, you are provided with the resources to find the in-depth information, and sufficient information to know what you need to be looking for.
If you’re completely new to UNIX, it’s recommended that you start at the beginning, and work your way through at least Lesson 7, “Reading Files.” By the time you’ve completed Lesson 7, you will have mastered enough UNIX commands to give you an idea of what UNIX is all about and to let you start being productive with UNIX. You are, of course, encouraged to continue with the rest of the lessons. If you have a particular task in mind after you’ve completed Lesson 7, you will be ready to pick and choose what you need to know from the remaining lessons.
If you already have some familiarity with UNIX, but are looking for a quick-start on some more advanced topics, feel free to pick through the lessons for the portions about which you want to learn. No examples in the book rely on the results of previous examples, so you can step in anywhere you want. If your UNIX experience is such that you’re comfortable moving around, and perhaps executing a few programs, you might feel ready to tackle some of the more advanced topics right off. You’re encouraged to at least skim through the introductory lessons anyway, as you might not have been exposed to some of the “philosophy” of UNIX yet. This can be helpful in understanding the how and why of some of the more sophisticated lessons.
Who This Book is For
This book is aimed primarily at the user coming to UNIX for the first time, or with very little UNIX experience, who wants or needs to become a productive UNIX user without a large investment of time. The lessons are styled, and commands and options presented, in such a way that the new user can quickly start to use UNIX without needing to grasp all the intricacies of each and every command. In addition to the most common commands and command options, the user is given the capability to find more information as his or her needs grow. In the more advanced lessons, the user is presented with an overview that is sufficient to demonstrate the possibilities and capabilities inherent in the UNIX environment, and with the tools to begin to take advantage of those capabilities.
Users who have used UNIX for some time—but only casually—who find that they want to learn more or to be more comfortable with UNIX will also benefit from this book, both as a quick reference and as a stepping stone to greater understanding and fluency with the OS.
A Quick Note from the Author
Don’t let UNIX intimidate you—whether you’re here for work or for pleasure, don’t let your UNIX experience frustrate you. The single largest problem that I see new users experience is that they allow using UNIX to become work, rather than making UNIX work for them.
UNIX is a very powerful operating system that will enable you to customize it to suit your personal wants and needs, and this book will show you how to make it work for you. In years of training users to use UNIX machines for a computer graphics lab, I have seen far too many users refuse to actually learn how to make their machines work for them. Instead of investing a few minutes in learning how to customize the OS and environment to make their lives easier, they spend hours or days plodding through repetitive tasks by hand. You can make your life easier, your work go faster, and your computer experience much more pleasant if you think of UNIX as a box of parts which you can put together to create any tool you want. Singly, none of the parts is particularly interesting or powerful, but by correctly assembling these parts, a clever user can make UNIX do almost all his or her work automatically.
Read the book, work through any examples you need, but most importantly, remember that what is contained here is only a teaser of what can really be done with UNIX.
Conventions Used in This Book
This book uses the following conventions:
In addition, this book uses the following sidebars to identify helpful information:
Tips:
lead you to shortcuts and solutions that can clear up confusion or save you time.
Cautions:
help you avoid common pitfalls.
Plain English:
explains new terms and definitions.
About the author
| Table of Contents |