CHAPTER 1 - ABOUT UNIX
What is Unix?
Unix is a computer operating system. An
operating system is the software that provides the interface between
the hardware of a computer system and the applications programs
that are used on it. Simply put, the operating system provides
the link between the hardware of the computer and the user. Popular
operating systems include DOS (used on PCs) and VM/CMS (used
on mainframes, now becoming rare). Unix is available on a wide
variety of computer systems, including personal computers, workstations,
mainframes and supercomputers. It was developed for, and is particularly
well-suited to, multi-user systems, but is now also run on 'stand-alone'
A little history
Unix was first developed in the early
1970s at Bell Laboratories in the USA. It was originally developed
as a system to be used by the staff in the laboratories, and it
was principally intended to provide an operating system that people
would enjoy using. It was designed for users who were largely
computer scientists, which may explain some of the more arcane
and apparently unfriendly features of Unix, such as the obscure
sounding command names. AT&T (the owners of Bell Laboratories)
made Unix available at nominal cost to academic users, with whom
it became popular. This helped to create a market for Unix, at
a time when technological changes had themselves created a need
for a portable multi-user operating system. As a result Unix began
to be adopted by non-academic users in the 1980's as it became
commercially available. Several standards are now being worked
out, and Unix is steadily becoming the standard operating system
in many environments.
What's special about Unix?
Unix has the following
advantages: Portability Unix is written in the high level language
C. This makes it easy to install on new computing systems. Applications
written to run on a Unix system will hopefully run on any Unix
system, regardless of the hardware. Popularity Unix is available
on many widely-used systems. It is very widely used and it has
become the de facto standard for academic users, and for all multi-user
A wide and growing range of applications software
is available. Unix provides a range of tools that can be combined
and manipulated to perform such a wide variety of jobs that users
of the system can very often carry out sophisticated tasks without
writing programs in a programming language. Standardisation Although
there are many versions of Unix, these are already largely compatible,
and official standards are currently being defined.
Different Unix systems
They are many different versions of Unix, as well as some
Unix 'lookalikes'. The most widely used are:
System V (distributed by the original developers, AT&T)
Berkeley BSD (from the University of California, Berkeley)
SunOS, now known as Solaris (from the makers of Sun workstations)
Xenix (a PC version of Unix).
The kernel and the shell
The Unix operating
system consists basically of the kernel and the shell. The kernel
is the part carries out basic operating system functions such
as accessing files, allocating memory and handling communications.
shell provides the user interface to the kernel. A number of shells
are available on the Unix operating system including the Bourne
shell and the C shell. The shell is basically an extensive program
that runs all the time that you are logged on to the computer,
and provides an interactive interface between the user and the
computer functions. The C shell is the default shell for interactive
work on many Unix systems. It will be covered in this document.
chapter 13 below for more details.
Graphical User Interfaces
Graphical User Interfaces (usually written GUIs and pronounced 'gooeys')
provide an alternative user interface to shells such
as the C shell and Bourne shell.
GUIs provide a replacement to
the command line interface based on the use of icons, menus and
a mouse. Using GUIs, applications software from different suppliers
can have a consistent interface, which reduces the time needed
to master new applications.
If you have access to a workstation
or a powerful PC with the necessary software, you may wish to
attempt to master a GUI, especially if you are already used to
using a PC windows environment. You can create shells within a
GUI environment and continue to work through this course, as well
as having more utilities available to you. Using a GUI will not
be covered in this course however, since the lack of a standard
means it is not clear which should be taught. Furthermore, the
commands and utilities taught here deal with Unix at a more fundamental
level than GUI interfaces provide, and what you will learn here
will give you an insight into how Unix actually works, give you
access to the full power and flexibility of Unix. The skills learned
here should be of use in many different applications and environments.
tutorials should be available with GUI implementations and provide
an introduction to their use.
Standard Unix implementations offer a variety
of text editors and formatters.
It is essential
that a Unix user becomes reasonably proficient in the use of at
least one editor if they want manipulate text files. Most users
nowadays with experience of word-processors prefer a screen editor,
and these generally provide the friendliest interface. There are
good reasons however for learning to use the Unix line editor,
as it's use involves learning a great deal about the way that
Unix commands and programs deal with strings, texts, contexts,
etc.. In this course we will therefore look in some detail at
ex, the enhanced Unix line editor, and at the other text processing
utilities that have been built on the basic ex functions. You
are recommended to look ahead to the
chapter on ex as soon as
you have need of a text editor. If you find using ex impractical,
use a screen editor. The standard Unix screen editor is vi, but
as this is built on ex, you need some knowledge of ex to make
use of the majority of it's functions, which are in any case very
different from those of a modern editor. Some version of emacs
is usually available on Unix systems, and it may be best for you
to use this. Emacs is available on other systems, such as DOS,
and is a good general purpose editor.
On the other hand, the advantage
of using vi is that it is always available in basically the same
form on any Unix system, so if you learn vi, you know that you
will always be able to use a screen editor on any Unix system.
What is more, once you have learned about ex, you will be to exploit
some of the power of vi without much extra effort. It is therefore
certainly worth having at least a basic familiarity with vi, and
many users use it as their preferred editor. The decision about
which editors to use and when depends on your own needs and preferences.
If you want to use a screen editor straight away, use emacs, or
whatever is available on your system. At a later date, a little
effort to learn vi could be well rewarded.Further reading: Documentation
on vi is available on-line (type man vi) and in the SunOS manuals.
There is a prose introduction in chapter 24 of
you are using some type of windows program then there will be
a simple interactive screen editor (such as textedit with OpenWindows)
available with the program, and this will be more suitable than
emacs for simple tasks.
Unix has its own text formatters
(principally nroff and troff.) and systems will often support
other documentation software, such as TeX. Many users will have
no use for these, and will prefer to use a word-processor. A short
introduction to nroff is given in