The Unix Operating System
- Unix is a type of computer operating system (OS).
- What is an operating system???
- A: A control program that works with users to run programs, manage
resources, and communicate with other computer systems.
- Several users can use a Unix machine at the same time, hence,
Unix is a multiuser
OS.
- Thus, Unix is much different than working on a PC or MAC which
were designed typically only one user uses a machine at a given
time.
- There are over 250 Unix commands:
- some are very simple, e.g., copying a file
- some are very complex
- Unix is also a multi
choice system:
- In other words, there are often many ways to accomplish the same
task.
- This is not true to the same degree with MS Windows or MAC OS.
- Unix is therefore, much more complex (and often frustrating) than
running Windows or a MAC.
- To make matters even more confusing, there are many different
versions of Unix and many other systems that imitate Unix functionality:
- Sun Solaris
- HPUX
- IBM AIX
- SGI Irix
- Linux (not truely "Unix"):
- BSD Unix (also not truely "Unix", but perhaps more
so than Linux):
- Apple OS X
-
Brief History of Unix
- Was developed as a "fun" project by a couple of programmers
working for AT&T Bell Labs back in the late 60's.
- AT&T along with the Massachusetts Institute of Technology
(MIT) were co-developing a massive, monolithic operating system
called Multics.
- Around 1969, Bell Labs became disillusioned with Multics, it
was slow and expensive.
- However, it had some nice functionality within it and it was a
multi-user system
- Multics was ported from a GE mainframe computer to a Digital Equipment
Corporation (DEC) PDP-7 computer.
- On this machine, Multics was refined into what we now call Unix.
- The Bell Labs computer programmers continued to improve Unix.
- The first customer of a computer running Unix was the Patent Department
inside Bell Labs where it was an instant success.
- In 1973, Unix was written in the C programming language for portability
and speed.
- Bell Labs was prohibited from selling Unix, thus in order to distribute
their OS system, they sold it to colleges and universities for a nominal
charge.
- Thus, it was in the 70's when Unix became a widely used OS, but only in
the college/university/research environment.
- Unix ran very well on powerful computers used for research and therefore
became the OS of choice at universities around the country.
- Since the 70's, Unix has undergone significant changes and improvements
made by a number of institutions including:
- University of California, Berkley
- University of Maryland
- University of Deleware
- Duke University
- MIT
- Hewlett-Packard
- Sun Microsystems
- Digital Equipment Corporation
- In the 80's numerous hardware vendors licensed Unix from AT&T
and developed their own variations to match their hardware.
- UC Berkley rewrote nearly all of the Unix system which
ultimately became the BSD operating systems (following a lawsuit
with the then current owner of the original Unix
copyrights). BSD is licensed freely.
- Around 1991, Linux was created based on the kernel written by
Linux Torvalds and the GNU
collection of Unix utilities. Linux contains no Unix code but is
modelled after the functionality found in traditional Unix.
-
Introduction to a networked environment
This space for rent.
-
The Unix shell
The shell is both an interactive interface to the operating
system and a programming language. We will be focusing on
interactive use for this course. The shell acts as an interpreter
between the user and the system. Commands are entered to the shell
which interprets the command and performs the action the user
requested.
There are many different shells which can be used on different
Unix systems. Cshell and Bourne shell are probably the two most
commonly used shells but there are numerous others. For this
course, we will be using the C-shell which derives it's name from
the fact that it's programming syntax is somewhat similar to the C
programming language. Most of what we will learn will apply to
other shells although the syntax may vary depending on the
particular shell.
The shell is not the command window (not necessarily). Often a
terminal window is thought to be the shell. Different shell can be
operated within the same terminal window or console.
-
Unix command structure
Nearly all Unix commands follow the same basic structure in how
they are entered.
command -option argument --more-options
An example:
|
|
mark@platypus:~> uname
Linux
mark@platypus:~> uname -m
i686
mark@platypus:~> uname -m --processor
i686 unknown
mark@platypus:~> uname -mp
i686 unknown
mark@platypus:~> uname --processor --operating-system
unknown GNU/Linux
mark@platypus:~> uname -po
unknown GNU/Linux
mark@platypus:~> uname -p -o
unknown GNU/Linux
mark@platypus:~>
|
The "command" will be the first item on the line. It is
the program (or function) that the shell is to execute. Following
the command are the options. Options generally start with a leading
dash "-" and are separated from the command by one or more
spaces. Options are used to modify the behavior of the program from
its default action. Options are commonly one character in length
and can be listed separately or combined. "Long options"
are somewhat unique to Linux and free software in general and will
be found less frequently on commercial Unix systems. They are
generally more descriptive than the typical command options and
begin with a two dashes "--". Command arguments can be
used in many different ways depending on the command. They can
modify the behavior of the command or tell the command what data,
files or systems to act on. Remember that all commands and options
are case-sensitive.
-
man pages
To get help on a unix command, the most common source is the
manual pages. The man program is used display the
manual page for a program.
man programname
As an example, if we wanted to get more information about the
man program we could enter:
man man
If found, the man program will display the page in a viewer on the
terminal. Manual pages are structured in the same manner for each
command. They start with the "name" which names the
program and provides a very brief description of the program.
The "synopsis" section shows how the command is
implimented with an often overly verbose example. The
"description" section will explain what the command does
and how it works. The "options" section explains how each
available option will modify the behavior of the program. There are
several other sections which may follow in the man page depending on
the command. The man page viewer can be terminated by hitting the
"q".
The collection of man pages may be searched with the
apropos command. This will allow a simple keyword
search of the brief descriptions for each command. The option
"-k" to the man command will also perform the
apropose search (Example: man -k uname).
The whatis command does a similar search as the
apropos command but searches the command names instead
of the descriptions.
-
Other sources of help
There are number of other sources of help on a Unix system. Many
programs will display a brief help description if entered with the
long option "--help". This is typical for
GNU utilies found on Linux and FreeBSD but less often on commercial
versions of Unix.
The GNU project also provides "info"
documents for their help files. The info documents are often much
more descriptive and allow browsing between chapters rather than a
linear stream of text like the man pages. Unfortunately the info
viewer is much more complex to navigate and will usually require
some effort to learn how to navigate. The info viewer is invoked
with the command info.
On Linux systems there is usually a collection of documents found
on the file system in the /usr/doc/ directory. These can be in many
forms (plain text, postscript, html, pdf, etc.) The information
here is often more detailed but is not consistent in it's quality or
depth.