Professional Documents
Culture Documents
History of UNIX
• 1969: Developed at AT&T Bell Labs in Murray Hill, New Jersey, one of the
largest research facilities in the world. Created in an environment when most
computer jobs were fed into a batch system.
• Developed by researchers who needed a set of computing tools to help them with
their projects and their collaborators. Allowed a group of people working together
on a project to share selected data and programs.
• 1975: AT&T makes UNIX widely available - offered to educational institutions at
minimal cost. Becomes popular with university computer science programs.
AT&T distributes standard versions in source form: Version 6 (1975), Version 7
(1978), System III (1981).
• 1984 to date: University of California, Berkeley adds major enhancements,
creates Berkeley Standard Distribution (BSD)
• 1984 to date: Many Berkeley features incorporated into new AT&T version:
System V
• UNIX has become the operating system of choice for engineering and scientific
workstations.
• Two variations maintain popularity today, AT&T System V based and the
Berkeley Standard Distribution.
• Current versions (1/95)are System V release 4.2 .and 4.4 BSD
• Work is in progress to develop a Portable Operating System specification based
on UNIX (IEEE POSIX committee).
UNIX Philosophy
• Make each program do one thing well. Reusable software tools: 1 tool = 1
function
• Expect the output of every program to become the input of another, yet unknown,
program to combine simple tools to perform complex tasks
• Prototyping: get something small working as soon as possible and modify it
incrementally until it is finished
• Use terse commands and messages: reduces typing and screen output
Why UNIX?
• Hardware independence
o operating system code is written in C language rather than a specific
assembly language
o operating system software can be easily moved from one hardware system
to another
o UNIX applications can be easily moved to other UNIX machines. Porting
is usually as simple as transfer of the source and a recompile
• Productive environment for software development
o rich set of tools
o versatile command language
• Distributed processing and multi-tasking
UNIX Components
• Kernel
o The core of the UNIX system. Loaded at system start up (boot). Memory-
resident control program.
o Manages the entire resources of the system, presenting them to you and
every other user as a coherent system. Provides service to user
applications such as device management, process scheduling, etc.
o Example functions performed by the kernel are:
managing the machine's memory and allocating it to each process.
scheduling the work done by the CPU so that the work of each user
is carried out as efficiently as is possible.
accomplishing the transfer of data from one part of the machine to
another
interpreting and executing instructions from the shell
enforcing file access permissions
o You do not need to know anything about the kernel in order to use a
UNIX system. These details are provided for your information only.
• Shell
o Whenever you login to a Unix system you are placed in a shell program.
The shell's prompt is usually visible at the cursor's position on your screen.
To get your work done, you enter commands at this prompt.
o The shell is a command interpreter; it takes each command and passes it to
the operating system kernel to be acted upon. It then displays the results of
this operation on your screen.
o Several shells are usually available on any UNIX system, each with its
own strengths and weaknesses.
o Different users may use different shells. Initially, your system
adminstrator will supply a default shell, which can be overridden or
changed. The most commonly available shells are:
Bourne shell (sh)
C shell (csh)
Korn shell (ksh)
TC Shell (tcsh)
Bourne Again Shell (bash)
o Each shell also includes its own programming language. Command files,
called "shell scripts" are used to accomplish a series of tasks.
• Utilities
o UNIX provides several hundred utility programs, often referred to as
commands.
o Accomplish universal functions
editing
file maintenance
printing
sorting
programming support
online info
etc.
o Modular: single functions can be grouped to perform more complex tasks
UNIX was one of the first operating systems to be written in a high-level programming
language, namely C. This meant that it could be installed on virtually any computer for
which a C compiler existed. This natural portability combined with its low price made it a
popular choice among universities. (It was inexpensive because antitrust regulations
prohibited Bell Labs from marketing it as a full-scale product.)
Bell Labs distributed the operating system in its source language form, so anyone who
obtained a copy could modify and customize it for his own purposes. By the end of the
1970s, dozens of different versions of UNIX were running at various sites.
After its breakup in 1982, AT&T began to market UNIX in earnest. It also began the long
and difficult process of defining a standard version of UNIX.
Due to its portability, flexibility, and power, UNIX has become a leading operating
system for workstations. Historically, it has been less popular in the personal computer
market.
Today, the trademarked "Unix" and the "Single UNIX Specification" interface are owned
by The Open Group. An operating system that is certified by The Open Group to use the
UNIX trademark conforms to the Single UNIX Specification.
According to The Open Group's Web site, "As the owner of the UNIX trademark, The
Open Group has separated the UNIX trademark from any actual code stream itself, thus
allowing multiple implementations. Since the introduction of the Single UNIX
Specification, there has been a single, open, consensus specification that defines the
requirements for a conformant UNIX system. There is also a mark, or brand, that is used
to identify those products that have been certified as conforming to the Single UNIX
Specification, initially UNIX 93, followed subsequently by UNIX 95, UNIX 98 and now
UNIX 03. Both the specification and the UNIX trade mark are managed and held in trust
for the industry by The Open Group."
The operating system controls all of the commands from all of the
keyboards and all of the data being generated, and permits each user
to believe he or she is the only person working on the computer.
The features that made UNIX a hit from the start are:
• Multitasking capability
• Multiuser capability
• Portability
• UNIX programs
• Library of application software
Multitasking
Multiusers
The computer can't tell the printer to print all the requests at once, but
it does prioritize the requests to keep everything orderly. It also lets
several users access the same document by compartmentalizing the
document so that the changes of one user don't override the changes
of another user.
System portability
UNIX comes with hundreds of programs that can divided into two
classes:
UNIX Communications
E-mail is commonplace today, but it has only come into its own in the
business community within the last 10 years. Not so with UNIX users,
who have been enjoying e-mail for several decades.
Applications libraries
UNIX as it is known today didn't just develop overnight. Nor were just
a few people responsible for it's growth. As soon as it moved from Bell
Labs into the universities, every computer programmer worth his or
her own salt started developing programs for UNIX.
The three levels of the UNIX system: kernel, shell, and tools
and applications.
The kernel
The heart of the operating system, the kernel controls the hardware
and turns part of the system on and off at the programer's command.
If you ask the computer to list (ls) all the files in a directory, the
kernel tells the computer to read all the files in that directory from the
disk and display them on your screen.
The shell
There are several types of shell, most notably the command driven
Bourne Shell and the C Shell (no pun intended), and menu-driven
shells that make it easier for beginners to use. Whatever shell is used,
its purpose remains the same -- to act as an interpreter between the
user and the computer.
Date commands
Day
Week
Month
%m mm month 02
%h Mon Feb
Century
%C cc century 00–99
Date
%D mm/dd/yy 02/10/10
%F %Y-%m-%d 2010-02-10
Hours
%l
(Lowercase hour (12 hour clock) 8
L)
%I
hour (12 hour clock) zero
(Uppercase 08
padded
I)
Minutes
%M MM minutes 03
Seconds
%S SS second 00–60
(The 60 is necessary to accommodate a leap second)
%N nanoseconds 000000000–999999999
Time
Time zone
GNU date, but not BSD date, recognizes - (hyphen) do not pad the field and _
(underscore) pad the field with spaces between % and a numeric directive.
[edit] Options
-n don't synchronize the clocks on groups of machines using the utility timed(8). By
default, if timed is running, date will set the time on all of the machines in the local
group. -n inhibites that.
date [-u|--utc|--universal] [mmddHHMM[[cc]yy].SS The only valid option for the this
form specifies Coordinated Universal Time.
--utc, --universal Coordinated Universal Time local TZ Sat Feb 5 09:49:59 EST 2005
-R, --rfc-822 output RFC-822 compliant date string, example: Wed, 16 Dec 2009
15:18:11 +0100
--help
The Single Unix Specification (SUS) mandates only one option: -u, where the date and
time is printed as if the timezone was UTC+0. Other Unix and Unix-like systems provide
extra options.
[edit] Examples
date "+%m/%d/%y"
7/4/06
date "+%Y%m%d"
20060704
START=`date '+%r'`
echo $START
03:06:02 PM
sleep 5
echo $START
03:06:02 PM
N.B. the variable has the time when it was assigned.