• What is UNIX.
• History of UNIX.
• Why we use UNIX.
• Features of UNIX.
• Basic Structure of UNIX.
• Accessing a UNIX system.
• Advantages & Disadvantages of UNIX.
• Difference between UNIX & DOS.
• UNIX Commands-Internal & External.
UNIX is an operating system.
An operating system is the program that controls all the
other parts of a computer system, both the hardware and the
software. It allocates the computer‟s resources and schedules
tasks. It allows us to make use of the facilities provided by the
system. Every computer requires an operating system.
The first version of UNICS (UNiplexed Information and Computing
System) was created in 1969 by Kenneth Thompson and
Dennis Ritchie, system engineers at AT&T's Bell Labs.And in summer
1969 UNIX was developed.
In 1973 they rewrote the Unix kernel in C to make operating system
“portable” to other computers systems.
In 1977 it released the first Berkeley Software Distribution, which became
known as BSD.
The 1978 release of Version 7 included the Bourne Shell for the first time.
By 1983 commercial interest was growing and Sun Microsystems produced
a UNIX workstation. System V appeared, directly descended from the
original AT&T UNIX and the prototype of the more widely used variant
UNIX released Ten editions between 1971-1989.
One of the biggest reasons for using Unix is networking
Unix is ideal for such things as world wide e-mail and
connecting to the Internet.
Because Unix was developed different people with
different needs it has grown to an operating system that is
both flexible and easy to adapt for specific needs.
Unix is more secure than Windows.
UNIX is a multi-user, multi-tasking operating system.
Multiple users may have multiple tasks running
UNIX is a machine independent operating system.
Not specific to just one type of computer hardware.
Designed from the beginning to be independent of the
UNIX is a software development environment. Was born in
and designed to function within this type of environment.
The Kernel of UNIX is the hub of the
It allocates time and memory to
programs and handles the file store and
communications in response to system
The shell acts as an interface between the user
and the kernel . When a user logs in, the login
programs checks the username and password, and
then starts another program called the shell. The shell
is a command line interpreter (CLI). It interprets the
commands the user types in and arranges for them to
be carried out. The commands are themselves
programs: When they terminate, the shell gives the
user another prompt (%,on our systems).
This is the original UNIX shell written by Steve
Bourne of Bell Labs. It is available on all UNIX
This shell does not have the interactive facilities
provided by modern shells such as the C shell
and Korn shell. The Bourne shell does provide
an easy to use language with which you can
write shell scripts.
There are many ways that we can access a UNIX system. The
main mode of access to UNIX machine is through a terminal,
which usually includes a keyboard , and a video monitor. For
each terminal connected to the UNIX system, the Kernel runs a
process called a tty that accepts input from the terminal, and
sends output to the terminal. Tty processes are general
programs, and must be told the capabilities of the terminal in
order to correctly read form, and write to, the terminal. If the
tty process receives incorrect information about the terminal
type, unexpected results can occur.
Every UNIX system has a main console that is
connected directly to the machine. The console is a
special type of terminal that is recognized when the
system is started. Some UNIX system operations
must be performed at the console. Typically, the
Console is only accessible by the system operators,
Logging in to a UNIX system requires two pieces of information:
A user name, and a password. When we sit down for a UNIX
session, we are given a login prompt that looks like this-
Type your username at the login prompt, and press the return key.
The system will then ask you for your password. When you type
your password, the screen will not display what you type.
When we are ready to quit, type the command exit.
Before we leave our terminal, make sure that we see the
login prompt, indicating that we have successfully logged
out. If we have left any unresolved processes, the UNIX
system will require us to resolve them before it will let us
log out. Some shells will recognize other commands to log
you out, like “logout” or even “bye”.
Full multitasking with protected memory. Multiple users can run
multiple programs each at the same time without interfering with
each other or crashing the system.
Very efficient virtual memory, so many programs can run with a
modest amount of physical memory.
Access controls and security. All users must be authenticated by a
valid account and password to use the system at all. All files are
owned by particular accounts. The owner can decide whether others
have read or write access to his files.
Available on a wide variety of machines - the most truly portable
Ability to string commands and utilities together in unlimited ways
to accomplish more complicated tasks.
The traditional command line shell interface is user hostile designed
for the programmer, not the casual user.
Commands often have cryptic names and give very little response to
tell the user what they are doing. Much use of special keyboard
characters - little typos have unexpected results.
To use Unix well, we need to understand some of the main design
features. Its power comes from knowing how to make commands
and programs interact with each other, not just from treating each as
a fixed black box.
•UNIX can have a GUI.
•UNIX is more secure.
•UNIX is multitasking.
•UNIX is case sensitive.
•UNIX uses forward slashes.
•UNIX is mainly used in servers.
•DOS cannot have a GUI.
•DOS in not more secure.
•DOS is not multitasking.
•DOS is not case sensitive.
•DOS is backward slashes.
•DOS is used in embedded
To ... UNIX MS-DOS
display list of files ls OR ls -l dir/w dir
display contents of file cat type
display file with pauses more type <filename> | more
copy file cp copy
find string in file grep OR fgrep find
compare files diff comp
rename file mv rename OR ren
delete file rm erase OR del
delete directory rmdir rmdir OR rd
change file protection chmod attrib
create directory mkdir mkdir OR md
change working directory cd chdir OR cd
get help man OR apropos help
display date and time date date, time
display free disk space df chkdsk
print file lpr print
display print queue lpq print
A command is an instruction given by a user telling
a computer to do something, such as run a single program or
a group of linked programs. Commands are generally issued
by typing them in at the command line (i.e., the all-text display
mode) and then pressing the ENTER key, which passes them
to the shell.
• TYPES OF UNIX COMMANDS
i. Internal Commands.
ii. External Commands.
I. INTERNAL COMMAND
These are the frequently used commands and are inbuilt into the
shell. These commands are loaded at the time of booting.The shell
has a whole set of internal commands that can be strung together as
a language(known as shell programs). The shell doesn‟t start a
separate process to run internal commands.
For example : „mkdir‟ is an internal command so when we type
„mkdir‟ , the shell won‟t look in its PATH to locate it.Rather it will
execute it from its own set of built in commands that are not stored
as seperate files.
II. EXTERNAL COMMAND
These commands are stored as a seperate program. A
command with an independent existence in the form of a
separate file is called an external command.
For example: programs for the commands such as ‟cat‟ and ‟ls‟
exist independently in a directory called the /bin directory. When
such commands are given, the shell reaches these command files
with the help of a system variable called the PATH variable and
executes them. Most of the Unix commands are external
This command is used to create a directory.
% mkdir MBA(FT) I
cd (change directory)
The command cd directory means change the current working
directory to new directory.
% cd MBA(FT) I
cp file1 file2 is the command which makes a copy of file1 in the current
working directory and calls it file2.
% cp [options] <source> <destination>
% cp file1 file2
% cp file1 [file2] … /directory
mv file1 file2 moves file1 to file2. To move a file from one place to another,
use the mv command. This has the effect of moving rather than copying the file, so
we end up with only one file rather than two.
% mv <source> <destination>
– The <source> gets removed
% mv file1 dir/
% mv file1 file2
To delete (remove) a file, we use the rm command.
We should enter this command with the -i option, so that we
will be asked to confirm each file deletion. To remove a file
named MBA(FT) I, enter:
rm –i MBA(FT) I
The command ‘cat’ can be used to display the contents of a file
on the screen. Type:
% cat science.txt
The „head’ command writes the first ten lines of a file to the
First clear the screen then type
% head science.txt
This command shows the bottom N lines of one or more
tail -# file [file ...]
Shows the contents of one or more text files
interactively. Have a lot of viewing options and search
more file [file ...]
shows lines in one or more text files that match a
given regular expression.
grep regular-expression file [file ...]