UNIX Tutorial

1. Introduction

Before moving on to using UNIX, let's briefly discuss what it is. A computer uses a set of programs, generally called the operating system, to manage its hardware resources (memory, disks, displays, input devices, etc.) on behalf of the user. UNIX is an example of such a system. It was originally developed as a research project at AT&T Bell Labs in 1969. Over the years, many versions of UNIX and UNIX-like operating systems (including Linux and Mac OS X) have been developed. These all work in much the same manner and all share the following characteristics:


UNIX was designed to be easily ported (moved from one hardware platform to another). It has been ported to everything from desktop computers to room-sized supercomputers.


UNIX allows many people to share the resources of a single computer simultaneously.


UNIX allows users to run multiple programs at once. UNIX imposes strict constraints which keep ill-behaved programs from affecting other programs and the operating system itself.

About the Shell

You will interact with UNIX through a special program called the shell. The shell prompts you for commands and hands these off to the operating system to be executed after you have typed them in. Commands are composed of two parts: the name of the command itself and arguments. Certain arguments, called options (usually introduced by the "-" character), alter the behavior of the command in a particular way while other arguments specify the entities upon which the command operates (e.g., names of files, computers, users). In the following example:

$ ls -l myfile

"ls" is the name of the command and "-l" and "myfile" are arguments. "-l" is an option which modifies the behavior of the "ls" command. Not all commands require options or arguments; many have intelligent defaults when none are specified.

The UNIX shell comes in two major flavors: the Bourne shell, sh , and the C shell, csh. Other popular shells are derived from these (e.g., ksh, bash, tcsh). Each shell uses a particular character (or string of characters) to prompt the user for commands; not surprisingly, this is known as a shell prompt. Exercises in this tutorial show the default shell prompt for bash, the "$" character. Except where noted, they will work equally well with most other shells.

Exercise 1.1

Pour a beverage of your choice (perferably cold and bubbly) and relax. This stuff is easy, and you might even enjoy it!