Uploaded by Annesha Naskar

1

advertisement
DescPite UA}x Orchiectwre
The entire ONIX 3yslem fs BuppmHed bggmeWhat
hondl o essentially 2impde thongh
albstradt oNCepts,
7
UAIX archiledwe Consists of 3 impoTdir
eatures
Kernel&Shell
bhe HHe & froasS
9System Calls
Kornel and hell
Kernel the ore othe eteratiny Stsem
a Colechion of g2ouhiney mosty wriHen în C.
7
the
loaded nko memomywhen
Kopnel
the haõaare,
Communiabs airecty uth
5ysem Is boaled and
thu
User prOgrams ( tha applcation)
use he Rrvices of kirnel,
hard
ore
w
he
access
to
ee
ha wSers ehalf.
neh pertoms th folb n
These Proyam access the kernel
Thhogn a sef of tnctioms alled Sysem ls
uSe
cP
u
uSENr
shell Shel
sl
Kerne
Hoadwov0
/soo
PDatulboseWhoBrowser
fi
kernel-shell
2alatiomshlp
Shell
Shell the Commond
inlerpraor
2 Shell n he aler
port of UNX Os
> Shell
actually
the user ond kornel.
nerace betwe
7Even tho ugh theuS
mly one kanel
umine on the sysem, thaTe Could b
Sevetalshells 'n
each user who s achon -naor
l p n.
The le and
ONIX
pocosS
Two Sinmple entheo
me
Ss em- the file ond pHOOSS suppot
FPle A
m
tes
and Can
Con
le
just an ato o
fein vinjvally any tung.
also tolaled b anothov e
ye'n9 poet a strelo he roachia
shuucture.
2
Unix Considor
dovi@ 0
Sy8lem.
omss
to0ss
directoni0o
members a -ha and
fil
the name 9iven o a
fle when 1m eculea as a
p oam.
fro@ss
a simp he tnt fnag'
oan exeeutalole fle
? Like hiles pro@ssen algs belng
to a sopanals hiercnchical leaa Sruchwe.
PaoCess
aaled as iving
OTganisms Whch l
onents
ie
S5 RE
h0e
@d
and btvn
ren
Children and hardchild
SySlem als
There ane over athowand
oommards
in the Syglem^thj
use a hord o brchims
Caled Sys em Cats ko communieu
wth tha kornel.
7 A tyPal UNIX ommand writes o
l e wtth the wnit Syslem (al
wrhout geing into the inmonds tha
Caly ochiene tho wrte Sys opeNaton
sysem Calls one built into the
karnel and interachion thoough them
represe an effrciem maans o
COmumrtahion wih tha0 Syslem
h a ovco tha eatwes af
UNI
ONIX
A mulkiuser Sygem
> UNlx o a mutiproprammin9
to 9un and
happen
Syslem
períSmuhple
proams
Compelpr atlenon d the CPU. This Can
in fio
NoMg
Mulkple usevs Can tun sepeU Jos
A Single usev Can cbo Jun mulhple jolb
are actualy shore
UNUNIx the rasowrC0
betwean al
2.
usersUN/K ma
mulhiuSem
Sysem.
UNIxA mulhtasking suslem
>A Sinsle user
also un mulkple task concuoan.
na
Con
mutitasking
UN /X
Syplem,
kernel
n
handle uger
ulhipe hds
s
3.
The Buildirg Bock
Approoch
UNY desigmer namer
allemped to pock ioo many leatunes into eo tods
7hre ono few hundrod
Common
ch owhich
ore
a
pentorme
Snple job og
1oleu many UNIX fodls ane
desined with the taguiroment that the output od one
tod be usea as inpt to another
hlerConeChng a mumlen a
toos e&an havo 79y
an longe numbo
Camloinats
their usage.
The UNIX Toolkit
Thee one gonenal punpae
toos, ext manipulatenn
UHes CCaled
and nlenpralens
flers),milers
network appicatonS
and Sysem odministration loðk
5.
Paleen machng
UNI eatwres nor
Sophishcaled paleen matchirg tectures.
6
orammirg facil
also a
: The UNIX shel
PrOSammi anauage
it a s designe
or a prOHammer, not a usual erd user
necessomt
71+ has all the
advoyialde
ngredents.uike comtrol shuchves, losps
progAnmn
that establishak aD a powentul
angmgein its
awm
icht.
Commands in UNIX
xprnal
1nerna
Sinces m a
ving a r
havir an
prostam o Tle
Independervl exislence n the /bio dirador
( /use bin
t
ekieirnal Cmmard.
> Most Crmmords one exlenna
branded as
On
In natwre
,Tfhiph one nd taalu4Oud
bwt thaTe ara Bome
anajwhere ana which ate
hey a e in one of the
nally not eeculed even
directome specafied b PATH
echo mnot an exlennal
omad n ba
lok
re cho,the shell ould
twil execue fom
s PAT o locatr . Ratten that a u
8toned ap
rdt
Comaris
in
Set built
rot
whan we
Sorse thal
bom
Sepenati les.
inpma
These bult în Command m known ab
Cmmands
Sholl s
cn exbrnal
Comnands P explain
ith a
Shell m an eonal omand
passesSes iis own setaf
deneneo
a cmmana
Tnlernal ommans. So if
a
the shell oo wl
of
Command
eists bon o an nonnal
the shell wll ovd top
Jusr/uin)
Mnal ome/bin r
to sanih rame
omand
of
fnlernal
P7iOefy to As own
Sirnilandy
eho m ako pur
ut haely
ever
shell makes
The
echo
Comma
eenral
eyeeuled
|bin
because
SWe that +he
nd bkes
in
inlerna
o
precedma_
Kamples o
inrna
and eipmal Comards in UNX
Intamal Commards
Cd) echo, Pud
exturnal Commonds
Tnrnal Comman
cal, da, s, gtup
Exer nal
Commard
These ora a set o
Tho ekEnal Comnards
omand built in a shell
On stoned ao
The shell will inlerprer
ls
t) The shell will nedd b
Creat an ehild pro@s
tho Commavd ard will
executu the result
and then ateul a
US
Commana.
The ShelI does yo
Ocaat a sepanau
Process o qun înepol.
CmandsLaslan
Daslan
i
xtennal Commay
haine the shelk
to
9 tt
Ceati a noLo Phoces
elahiely sloue
toW to ind whethan a Command s inlannal or
eXernal
for the inlennd Cormmonds, tha
Mpe lommand will elaoxdy Sau s shel
built-i) howewo
the exlera) Conmrarids
e s he path of the mmard komWhora
s execued.
bype cd
Cl wa sh ell builhin
$pe Cat
Cal t'sbin/ cat,
optim tells about all pe o
pe-a
Com
whethUr f is built-in ex
auasea
nal c
80me commads oo bth exlennal
and
buit-in.
Bu built-ín Comma
takes priooTly
p e - a echo
pe places
Auas ommard
rom
the
Cpli
a
shell with
a
oted Comrand
String. It
nothor
nto
a
smpler
nd il aluoay
one
strirg
Convonis
commona.
ine
in Commard
a
uas
Moking
CuuoS
lemporony
C nectesa
auas
e
Can
f0move
y s - 4 '
auas
unalho
with he holp af
unaluas
UTheoo UNX
Ca Ccmmamd in
UNIX
We can
invoke tha
cal
Commard to see the Calend&r
e an specthie
month or a
Compleu yaor.
This a ili
totally aCourah
and takes nto accoun tha
aap
R adjusimats that took
place
fn the
yovz D
1752.
7 Cal can be used wtthoul
angumans
nwhich Case splays the
c»lind
the cwdant month.
nony 2023
7
Coal
03
2023
MaRch 2023
Col
2023| more
P1peine. Ppeune Con nects
pcal3
tNo Com o d
shons CalendeL af
Previoo, ewUort&Net monlh
Cod-
b di'splay Comieta
eo Coalenda
SCal-m jnuo
We Can
5peaky the
mont's Name
da Command fn UN)x
UNK gem maintains an fneral
eloek meanl to zum
i's Shut dowm,
a
penpectualky.when me suslem
balery keeps iha eleck ticking. Thi's
eloek ectvaly Stores the nuney o seConds.
7 dat
Gmmand m sed tum dsplar
tho Syelem dat.
7
A 32 b
S ecmas
Counten stores the
cund Ccounen u l
ONenHo Somelne in 2038.
ne con display the uttarst data ui
datp Command
dc
Sat Jan 7
GMT: Greawich
Mean Tim
7
The Command
(8:O4:30 OAMT 2023
Con al30 be
WTh+ Praed omat
sea
Spezhr
AS Ongumentis.
paalk +%m
01
dect +%h
Jonuo
datr + %h%m
onuowg O
Lst of othe
omev 8pechees
d - The day of the month (lto31)
The last two digils of tha eaz
seconis
The our minuD,
H, M,S
D-The dotp n the +pomoat mm/dd/
The time in the fermat hh: ml ;95
O11 2023
+%D %T"
datr
O//23
18'25:30
Sdab +%Y- % m %o
-
2 023-01-ol
$datt +%Y/ %m/%d
2023)01ol
)
+%A
%B
%d
%T
%y
dot
uy Januony 18:25:30 O
Soturide
a
oM
YoS
3
Display in minute
Psplay in Secores
Display the houes
Pisplays tull Weskdays
%
Sunday to Saherday
Pspay hll month mam2
TaMON) ld
Decomoe
7YDspy towr ayt ga
Dspoup hz last Wo a
of
echo Command in UNIX
echo Ne used oe
displaaing masngeR.
7 The COmmano
is often uaea n shell scripis
7
to di'splay diognostie messag om youn nminod
o
to isste piopts tm
echo
takirg user npt.
FPlename not enteed"
echo s oftern used to evaluat shell vatiables
echo sHELL
ofo ash
We Cam use escope Sesuonca
ATRT versium
echo mot BD)
Bell
NO ONuO
C
Jormjedd
- Newine
r
-Carrioage atwm
t
ab
v
econ
verical tab
EMm st no
-e
IBsDversium
ophiom enales the fnen Þoatakiom
basash
echo -e
«
a
escapes
Hello\kNor ld jotow you aa
0moves
echo
echo
e
e Lello \n
all
tha spaCRS in beN
e lext
Wor ld"
This commmard wfill pint all ffles/foldes
SPmilar to ds camond
be enmand Pn UNjX
alculokm în UNIX
bc w used
UNIX Phovides Fno tpes of caleulators
a oaphical Objet (( the xa Commang
that looks lke one
he ext msl be
Comma.
be
2+3
5
7-3
be shaws the outpt
the Computahtm n the
4
23
next lune.
Ctrlt d
We can use , t a delimek
oc
2+3 2n3
5
8
echo
43+4'1 be
echo 2+3|be
=
echo 4
5
echo 'scale =3, 5/4
eat fPle
5+
2-3
29
beFlel
12
6
1Su
|be
Who
Command în UNIx
Who Command YsS used to Kow
he users,
Who
rost
onsole Aug 1 07:5
roh
Pts|}d
(:0)
Aug 1 0:56 ( PÅ23.abc m)
The irst Cohumn shons the nser-ads
oo
uSers Cworonty wriing on the &galem
Seamd coumn shaws tha
flenamao o
the devia es ag3o caled wilh fha raopeðie
erminals
Here noh{P's terminal has h
nama pts/1o Pts directy
0ila nana)
Third, towth and kitth cdumns
Shows he datr ad h'me logrg m
7 Lost oumn shons the e
hostname
om tne usen l03asd M
l o Know the usQN Jho invoke th9
ho Conmmad
who am
o
Hs/10
ugl 04: 56 (Pc23 ake n
Who Command îs used to d
out Ha
plltwng ngrmatiom
Tme a
last s
lm lst
22 uvunt un level of ths S lem
.
List of l0aaed fn users and more
l o splay
hastna ma ana user aBO Ciale
wh Sardand fnput
aho-m-}
To shon all active process e
Who -P 4
To shon 'st of users
lH9ed n to 3sen
Who-u
To shoo tme of the
syslkm When
o0olea lo ima
Who -b -He
To
S hoN
detoils o} cll daad paow
Who -d
To Cou
nmben o} users lo
Onb SSem
ho--H
To displey al
deturls of Cusvarv
3
oed n user
Whoa
To drsplay usev
denhf catiarn
tormotion
d
Download