used to organize the files and directories in intuitive ways. Furthermore, complex meth-
ods of accessing disks, tapes, and other devices were greatly simplified by representing
those devices as individual device files that you could also access as items in a directory.
Input/output redirection -- Early UNIX systems also included input redirection and
pipes. From a command line, UNIX users could direct the output of a command to a file
using a right arrow key (
>
). Later, the concept of pipes (
|
) was added where the output
of one command could be directed to the input of another command. For example, the
command line
$ cat file1 file2 | sort | pr | lpr
concatenates (
cat
) file1 and file2, sorts (
sort
) the lines in those files alphabetically, pagi-
nates the sorted text for printing (
pr
), and directs the output to the computer's default
printer (
lpr
). This method of directing input and output enabled developers to create
their own specialized utilities that could be joined with existing utilities. This modularity
made it possible for lots of code to be developed by lots of different people.
Portability -- Much of the early work in simplifying the experience of using UNIX led
to its also becoming extraordinarily portable to run on different computers. By having
device drivers (represented by files in the file system tree), UNIX could present an inter-
face to applications in such a way that the programs didn't have to know about the details
of the underlying hardware. To later port UNIX to another system, developers had only to
change the drivers. The applications didn't have to change for different hardware!
To make the concept of portability a reality, however, a high-level programming language
was needed to implement the software. To that end, Brian Kernighan and Dennis Ritchie
created the C programming language. In 1973, UNIX was rewritten in C. Today, C is
still the primary language used to create the UNIX (and Linux) operating system
kernels.
As Ritchie went on to say in his 1980 lecture:
Today, the only important UNIX program still written in assembler is the assembler itself;
virtually all the utility programs are in C, and so are most of the applications programs,
although there are sites with many in Fortran, Pascal, and Algol 68 as well. It seems cer-
tain that much of the success of UNIX follows from the readability, modifiability, and
portability of its software that in turn follows from its expression in high-level languages.
If you are a Linux enthusiast and are interested in what features from the early days of Linux
have survived, an interesting read is Dennis Ritchie's reprint of the first UNIX programmer's
manual (dated November 3, 1971). You can find it at Dennis Ritchie's Web site:
http://cm
.bell-labs·com/cm/cs/who/dmr/1stEdman.html
. The form of this documentation is
UNIX man pages -- which is still the primary format for documenting UNIX and Linux
operating system commands and programming tools today.
10
Linux First Steps
Part I