You are on page 1of 32

UNIX

OPERATING SYSTEM

What is an OS?

Evolution of Unix
1970s Bell Laboratories, USA Developed
Unix OS
UNIX Is written using C by Dennis
Ritchie

FEATURES OF UNIX

MULTI TASKING
MULTI USER
PORTABILITY
MODULARITY
SYSTEM SECURITY
DEVICE INDEPENDENCE kill command

LIMITATIONS
CASE SENSITIVE

LOGIN & LOGOUT


To Login Login Command

To Logout Exit or ^D (ctrl-D)

KERNEL

SHELL
TOOLS & APPS

Shell
A program that displays the prompt for
accepting user input.
Translates the command given by user
(command interpreter )
Sends request to the kernel
Maintains user accounts

Kernel
Forms Core of OS
File Management & Security
I/O Services
Process Scheduling
Memory Management
Interrupt Handling

Tools & Applications


Contains business applications, Word
processing tools, etc.,

File System- Broad classification


Ordinary Files
Contains text, data or other programs

Directory Files
Collection of programs and subdirectories. It has 2
fields - the name of file and a pointer to a separate
disk area.

Device Files
File containing the details of device such as, printers,
floppy drives, hard disks and terminals.

Structure of File System


root - Top Directory File

bin

dev

etc

<Files> <Files> <files>

mnt

tmp

<Files> <Files>

UNIX

usr

Bin

kumar

<Files> progs

sharma

safe

<Files>

<Files> <Files>

Structure of File System


Bin Unix Commands
Etc System Date & Time ,
Passwords, etc
Mnt - Library functions & files

UNIX COMMANDS
(page no: 196 onwards)

Chapter 16
Shell as a command interpreter
Displays the command prompt and receives
the user input.
Scans for special characters and rebuilds the
command received from user.
Passes the command to the kernel and waits
for its execution.
Displays the prompt again after command
execution.
Wildcard matching

Command processing steps


Parsing
Dividing the command into tokens.

Variable evaluation
All words preceded by a $ character are
evaluated as variables

Command substitution
The output of a command is given as the
input for another command .This is known as
Command substitution.

Command processing steps


Redirection
Input/output redirection
> - Input Redirection Symbol E.g.: cat > XYZ
< - Output Redirection Symbol E.g.: Write Sharma < XYZ

Wild-card interpretation
Pattern matching

PATH evaluation
To find the Unix command where it is stored in the
directory

SHELL TYPES
Popular shells are, Korn Shell, C shell, Bourne
shell
In these 3 types, both Bourne and Korn shell are
looking like same and they use the $ sign as the
prompt. But the C shell uses % sign as the
prompt.
But all of them have a similarity in the sense that
all the super user has a pound sign (#), when
they are using the root directories.

Shell scripts
When a certain set of commands need to
be executed frequently, shell scripts are
used.
Similar to Batch files in MS-DOS
Passing Arguments
Set and reference variables
Control flow commands like for, if-thenelse

File System
BB

SB

IL

DB

BB - Boot Block
SB - Super Block
IL - I-Node List
DB - Data Blocks

File System
The Boot Block
Contains the booting procedure (bootstrap).
Cold boot (improper shut down) Vs warm boot (proper shutdown)

The Super Block


Controls the allocation of disk blocks
Contains details about the active file system including partitions,
file lists, size etc.,

The i-node list

Contains the information about the files in the system.


Every file in the system will have an entry marked in this area.
Each i-node is of 64 bits length, 8 i-nodes per disk block.
i-list and i-number

Contents of an i-node
The file type (regular, directory,...)
The number of links (number of aliases
the file has)
The owner and the group.
The file mode (permissions)
Number of bytes, date and time of
creation, modification, last access
An array of 13 pointers to the file

Data Block

Contents of files
Stores data in physical blocks of 512 bytes
Sequentially organized (FAT)
Thirteen pointers
First 10, Direct addresses of a file
11-Indirect block (address of next 256 blocks)
12-Double indirect
13-Triple indirect

UNIX COMMANDS
(page no: 211,214,215)

Chapter 17
System Administration in UNIX

System Administrator
Super user is involved in,
Maintenance of User Accounts
Maintaining Security
Creating Backups
He holds the default directory
usr / admin (default path)
Unix provides menu driven shell for super user. It
can be invoked by,
#sysadm or #sysadmsh(xenix)

Tasks...
Creating Different File systems with appropriate
sizes
Formatting and partitioning of the hard disk
Installing of other add-on packages e.g., virus
updates
Establishing connectivity with terminals
Deciding the configurations of the terminals to
be used
Shutting down the system

Shutdown Process
Sending messages to the user terminals
to save their work and log out.
Suspending all activities except those of
the scheduler.
Updating the memory contents of the
super block and other buffers to the disk.
Dismounting the file system except the
root.
Switching off the system

Security Process in UNIX

Physical Security
Network Security
Account Security
File system Security
Testing Security

UNIX COMMANDS
(page no: 218 onwards)

Basic Commands
$
$
$
$
$
$
$
$
$
$
$

pwd
ls
ls l
ls x
ls -F
ls -r
cat filename
cat > filename
cat >> filename
clear
date

$
$
$
$
$
$
$
$
$
$
$

rm filename
cp file1 file2
mkdir dirname
cd dirname
cd
cd\
rmdir dirname
cal 04 2005
cal 2005
who
who am i

chmod
Change mode of operation
Syntax:
$chmod u+x filename
$chmod g-rx filename

Authority:
u - user
g - group
o - others
Rights:
r - read
w - write
x - execute

Thank you

You might also like