0% found this document useful (0 votes)
2 views18 pages

UNIX Module 1

The document provides an overview of UNIX system programming, detailing its architecture, including the kernel and shell, and their relationships. It discusses key features such as multi-user capabilities, multitasking, and the UNIX toolkit, as well as various commands and their functionalities. Additionally, it compares UNIX with other operating systems and outlines the significance of POSIX standards.

Uploaded by

Kvs061
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views18 pages

UNIX Module 1

The document provides an overview of UNIX system programming, detailing its architecture, including the kernel and shell, and their relationships. It discusses key features such as multi-user capabilities, multitasking, and the UNIX toolkit, as well as various commands and their functionalities. Additionally, it compares UNIX with other operating systems and outlines the significance of POSIX standards.

Uploaded by

Kvs061
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

UNIX SYSTEM

PRoGRAMM)NG

Module
1. txplain architehue
neat
the
diaqram.
UNIX
opatg
(OR)
Explain he kenel and shl labbnship
operatig Ayaton wia diagram(1om).

system in lospted mt 3 cateqoriU!


() Kernl Ound sh elt:
'UNIX, t . keunel fotrLets with the
the mahhek
T
and t e shell nfuato othn thu n
Kasduare
elatisrskip io depi ched im the
This User (Uzu)

Oher
soLhent Shell
Shell
Sholl
Kecnel

Pardware ogt)

ta B r o

Tert
procKOU.

Datos
The kernel i Core
when, tae ayptem là bootesd
lommntcafs dieety cwth the
haroware.
the hajdwar
User progra trat need to acces
e seYices the kernl, usti'cs pex7orms m
the gos on
the usu's
use's
bohaly memony, Bheolul
" The kernel managu He system's
elr pioribes peatome
proes, da etolu their
Other taski.

Shell:
The shel outeu oayt the opeyahy yoten
shich handes he tapabili hy ¢tanalatn
Commands mtachon. (an be done . a
command inter pebr.
The hel 0R the întrlate blw te
kernel.
Even hough hini is ony one herre nnhg
the Ayrte ytheu Could be ral shells
acton

(i) The Fe and Proces:


arvay bytee ard Can contain
vrhually anytthing is alo nelated to anota
fu by bng pat q a smge hierarhial stuchin.
UNIX does not care to know the bype a the
Dt consides ewen oietonu and
Nices a membess
Proces i:is the nenne qiuen to
exected a a program. simpy a tme mae
erecutabl tle.
UNIX provds toou eser
Cortol prounes, move hem duw koreqround 3
bae pownc, and uLen kolu them,
The Sylem Calls!
The UNIX corpates the keinet withte shel
and sta applicabios ." This 'ayítm a
wYIHen
System Catls
handyul tunchm to Gommunteale
oith
cals n HenUNIX
Au UNIX Havos haue
Qle.,. syiln cat
2. L'gt and Erplain Salient
the Salient featuw: the
UNIX oprahngzam (1om).
Sl"s The mayor
major jahsi the
preenkd as tolloWs:
) Mulh' user Systm:
UNIX a nubproram mig syatem 'whtch
permit muthple ,prögrama r and' onpete
to run
kot the attenttion te cpU. 'Thi Can hoppen

Mulbipu separab Jol.


Can alao' un multple' foe
Asingle
a 4 t
mgle: o m Jhe cPU, memoy
oleieakol to a
UNIK, the resOUIcis
UNX a muti'usr
bho al sers. Thus,
() Mult8basking Systen:

a ser to edit a se, pnt


wu
another le the prter, snd enail o.a
he World wide seb, alu
fnntand browse
LotHhoutLeanng any od th applicabions,
The kernel n,'derigud Yito handle

mitaukng. envjvon men, a wse &eeo: e


job unmng the e yoreground,
the background:
The yel Can bwith'obs bou en batkound and
terminat ' ttem.
7ore grund, spnd.
(ü) Building -Blok Approa eh:
Te uNX 8glem,. dusignr duetoped, few
heundred command'
only. a &ngu. job.
for' erampl, tee dvo commanole nd wc
be Ld ioith the -ppe) to' cont. the na

comman ds hot can be conmtd nt s ey


The
are callea iten becak they ler data

( ) The UNIX, Toolkit:


the kend jbey
The UNIX AepAesenlo thu keenel, butbenetit
dos not nw houw meh tha wyor.
it ch
Tues, hont applirabnu
that ave shipped wcth ey UNIs Byctem
These.,Qrt. gngal pur poge tools, teat manipuktb'on
compis
nter prtra, ntworhed ppliçators
and tysten ad mnbtaba toos, and chore
shells

UN teahus vwyy sophinhcakd


sophishi coted patrn mathing
teahue,
he s com mand
hapltrx
loith an unusual'arglnent Cchap )nsteaot o
expuiery 4pgal jlenams.
-n,iabspee'al charaetr ,weoo by he sytem
The that , t c a n , mate a nO.
to shd°cale
. Some., adraneed nd eft tools alo pe'al
epresioo egular prsin that. is oamud
uoith charaetrs

Faci liy'
UNIX hel is also
pregrammtg languag a
" The
wich wo deigned tos a prorammi and not
(asual. end se.
necesay shgredient ike Control
Jt hou all the
and vonabli that establish
uehureh loops
powwf
These feabs are wjed i to duign dhell scpts
cannoke UNIX command
which. oe. proqram hat
Docimiriahon
tattn cs sornetmes wneeren but at mot
UNr documen
eo
The pnncepal outtine hy taey aiaulabli
man' Command whih emain. the
rene fororimand and that onjrg1rato":
tes
Interna nd Extenal
3. Compare
UNIX opu abng sysm oth etampu. (6m):
)Extenal Commands:
Extrnaleomandyi are hose commgn Hot
houvigan andepenent aten q.
ere These comnandeare etecks ey are
1 he lreetones speefied, by.PATH.
Most commands an'uterndilin nawe k

ndepindeDt oitenain /bin dineetony'it ia


biandecd Kernal comm and, s
(Ö Imal Commands:
"8one Comnands ishlch
are not fouad
These oüre
ayte,nd cannot be eecied euen

Take he echo command

eho i a shell built.


echo, the hel orl not
Look n its PA[H ocate t. R¡thu, it wil
eteeute . 7orm,. bilt-tn eenat
These built-n Commans, ue
Commands.
kngwnsntonal
t. Outune mpoytane Posix anol Smge
the
yNIX fpeeticabtn Atandards (6m)
( Posir
The Postae operabng Jyttem Intx<a ca or Computer
Eovion nt gee to
baxd UNIX.
puabing sytims
TOO +fe most CSted btandasdls torn He
Posix oamily are and roSIX, 2.*

posIx.] apeeifis the Capputati on param shtefau


(suslim Cally), and posX. 2 daals with hel an d
ubtes.

Singe UNIX spcuticabon:


)
inthabhe Xlopen and 'tEEE eelted ni
A jont
the Lunifcathn q PoS X and UNIX. This iA known
NIX spepcation, Vers'on 3 (sUsv3).
&ngle
Tho "wrtte. once, adopt eeywhneppats to ttls
deuelopmert meas that onea
been oeweloped Gn any posIX - eomplaint UNIX
8ystem, it ealy ported to anotha
wrtt mm
Posx Dm plaint UNx mahiu
modahbns
s. Eplainthe otioung Comman d:
() Cal
The cal command Can be shiked to see ttu calenda
coimplee yen
accuiat and takes toto a c a t
Ths tacty totely
leop yeor adyutwt, hat fuok ptae
yptax:
Cal ([momi) yeo]
Cal ce n de ed without argument alo in wtich
t digtaus llsndou. ment month:
03 20o06
Qutput:
MoRch 9o06 4

Su, Mo be Th R a
11 2 3 4

12 15 16 19 133,
13 14
22: 2,3 24 .2y
26 2428 ,4 30 3)

date
The date comnand 'n unet to diglas he cuent
dat Lith [hous the dat and bme fo . the
neauest sRcoRd
4econd,
$. date
31 (6: 22: 40 LST 20os.
Outut Wed hug
() OneCan fhe month smg komat tln
print.only
dat +7 m

(i) Nonth neme weth


(i) echo: all shels
ws extenal
Qun command but today
Lcho
echo built-i
han
interprets eeotain stohgs knoun e
echo ommand
Arch,a teo cAaracter-stong
with le an edcae &qjen c
begimnhg
Syntar:
"Ents tlename : \"
$echo
lenamei
lanae: ¢
Qubput.. Enes

external ommandwhoch aL
The pm i ano thr
all sequini ied hy cho, kut
aceepba uape inst a newlne
t olod not
wnless the ln automahcjomattel y
ses
Thei pin7 aleo
th cAanguage
whent shell

) paasud.
command o ed to change
The pa t the acCont eloes not ha
know
possw
paswt hos that alieady
'to otes
butput: j kumar
pass wcdl: changng
changng pasod
wad: *****
Enr loqin pas
*********
New p QBBod:
Reentea ne pasud.
suceshuly
passud (ySTEM: passu kumo changed

who:
mantaing QUn account
who Logged tia the system.
The whe. command oisplay myoimatv
listmg the, wsus:
Ex: $utho
Output: 0ot
Coniole Aug 1 o:sI Co) avenscan)
4 b9:5G p n3.
kumar pts /o D210(p125. hoaiea.con
shasma pta/6
Explain e di7faent
contaa
Sol:
sequenu e charactess,
Jhealed
d'nded in to 3 catcgoties:
Fles Can

the most
An dinay diided: nto 3
Comnom
(a) Text Fe:
A txt
con tahs on y pphtable 'charakys
and the wrCan. otn

- # cotainsss chas acteisohse w


I is teimin ted wlth henewn,-chara
ine
(o) Binay Fui
ki, contuins botf, prntatle and
A binasy chaactes"hat
wnpaihtab (o to 2s).
ASCHÍ vange
commanols- anehiany tly .and the
Most UNIX produced
Coce and tecitabw hat
.by company C programd are alo bhay 7iles.
and bdeo s
Pictuey, 1dourd
a we
Dence
) ctasy

t e Com mands CiRd to acce ondnay


alo wok with
insrda a angle direbny
eie kound
Dute ylencune
steche d.
eice
The opeation q
attaibuks
hom
The henel tolont fu a oeue the dece
then o westhem
contains' nodata, buet keeps Do
A etou
Hhe
Con bain
organised
nised woith
with anmby
Thi UNIX re s8ytem ia This allos &
&ubdiretones!
direttoes 'dreee'to haue
dett n 4pavat
ilenam.
A dineetoy yle ontang has.
Abdiutoy hat it, housy. Each ety
Componnts
The tlename
The wnque tdentfication ,ne.neumber
die toy, alledi the noole
Desnt be Hhe
the paent-chilo elabbrshiy n N
system voith a neat d'agra (4m)
Sotts Relatel to Dne anotu,

The te system in UNIX a colle chion


all qansed
This
öot ():

bin der etc VOs


home b sbin stond trmptUr

Cat dat oho


Kuma shaia unix bin hude Sbih
The implit featue otho
there sop, whtch
pant
all
Calleol hoot and i reprentd by a /
hoot
..a cde tony.
has
The ripot ouctony ()
ndlee t. The WJborectones inhn,hane"b
-d'rectone and oth tes incli them,
apart om oot k muy t han a paret,
Evay &e, Ahould
t
be pos6bu to trae the ltmat
and
to r06l
percentag Ba yle
In th above 'gue,
gue, home directony is te parent
o kuma, potent
te paent ho,and the
qrandatt kumar.
In this. parent-ch ild elahonshp, the pant is aay
n the above 'qure, hone and kumar
ooth aectoies, whas ogh. sal

8. bxplain the 7otlowmg conmands with kyntax 4


erampla (Any 3 jo '1om)
) pod: (pnnt wonthg dieekay...
The wser Can dreetony to
anot but at qy poht . Ane,
Be current
dU'reetony, calld
Jocated
dvecony
pwd command tellu Hase he ccent dey
that the
Output: homekumae.
tcl (change anoundhe
The d comnnand to movie

to the dlit tony pefed avgumn f.


r

o/: horme /kumar

oh /hoe/kumar/ prog
also
tan clho ba Used i withot iany. aigument
pod
dp: hoe kumad /qrog

el: homeJkumas

(tü) mkdir (make directony)


Direetonu Qre cratd mkdiy Command.
he cOmmand hame

lectohil to be e ated.
unc cuslent
dihietory path. is seatd
A

mhdis pateh.
A numbu fubdie ehone eated

mkdis Command
mkdir patch dbs dac Three dëreconts created)

The mdir (remove dretoy) command remoues


Aireetonies.
To Temove
seo
Smdir pìs shold
mportent hat gou
riles
" Thee duo
jernembe diretodi!
dulteadreetony::with m r unles
One Cannot
emyly:
cannot emove asoeetooy.
unlesa the
One
han
placed a a
has

cod pro9

Absoite and Relate


Ces betueen
4. Outthe the aiun
Pathnamsi|M)
Pathnans
pathiname specps
An abiotute he ot dreey
whe
dinechoy Abaucke.
The Abtolat patname taty ojh oot ) diebiu
etoy ate the hoot is holuded in t
Evy i
poah..
Ex you placad i

donu by ung the belaw coMnand


Cat. /hoaltumar/logn- gl.
() Relate Pathiames:
A elothe
pathnarne"peet frsi the locabim q a fl
dieety elatve to he cwent wortng ietoy.
A elatne pothname docs not stast with te 0ot.()
lectony but athr ro n wtire youi cuenty an
dreeton teture.
rorCon&LdA the aou etetmple tte yout
to aecess th

A late pathname q thin ryphe


Bymbola:ti
. (zngla olot) - Reprtxnta unt de tÝ`y
.. (doible olo) Represent parent dirtoy
Assune that
progldatafet You can:
(homefkumay
4

lhome kmar /pr lolata t


t Ihome Jkumar/ prog ldata tert

homlnor/ prog/data
Explain:the Aeati diagian
totlowmg bque' depctr a hea'y tomnuod (or)
S The
stuebure. o a sandard
G.1).
The entire. compisy , heo qoup!

He' ateA thatan mado


() The t't quoup contauhd ngtallabani
avalabe dung syim areterdretons ohee
/bin and usrbin Thex
uyed UNIX ornmano are kound.
a tae common tho
/sbn end Zis/sbin but'the sstam
youeannot eecute
Command hat bein
admnistrator can,hen it wculo ppbaby
these di'recones.

di'ne ctony contans he


lete- This yotem
the all dnce hles
tontus
Ths dire ctory on disk
lder olon't occpy contaig all
les cont
fhese
fusr/üb- Thiu diectoy
/b and
Contains sfhe standard haadr yd

This i; where the man


pages
/usrlshare/man
stoved. There ore Keparat, subdircbnu here,
are
that Contain the paqes to ea ch, sechon
4

woik, aith thur oun.


ad uie maiu ond
watk phorarns bend.
These
shown bolo;
un the seeond
avcllakle
asL alewed
The diutouis,
fee
te. The jile al e

veate emgoy
Jo the systern.
'requlasy. by the 7ile
var The wanable paat
Containd
imaily
,.are housed hert
many syrng Uitys
On.
difeent
home iiectoies.
Jocabon

You might also like