N. Gorse –Mar. 2005
In tr o d u c ti o n à U N IX IF T 2 8 8 0 U n iv e rs it é d e M o n tr é a l
N. Gorse –Mar. 2005Introduction àUNIX 2
In tr o d u c ti o n H is to ri q u e 1 9 6 6 – D é b u t d e l a c ré a ti o n d 'U N IX 1 9 6 9 – p re m iè re v e rs io n d 'U N IX 1 9 7 3 – R é é c ri tu re d e U N IX e n C 1 9 7 4 – p re m iè re s l ic e n c e s p o u r u n iv e rs it é s 1 9 7 8 – p re m iè re s v e rs io n s c o m m e rc ia le s A n n é e s 8 0 – A u to ri s a ti o n d e c lo n a g e
–S ys te m V – m o y e n n e s e t p e ti te s c o n fi g u ra ti o n s
–B S D – c o n fi g u ra ti o n s i m p o rt a n te s
N. Gorse –Mar. 2005Introduction àUNIXIn tr o d u c ti o n F o n c ti o n n a li té s G e s ti o n d e s r e s s o u rc e s d e l 'o rd in a te u r
–M u lt i ta c h e , m u lt i u s a g e rs , m u lt i p ro c e s s e u r G e s ti o n d e s d o n n é e s
–O rg a n is a ti o n e t a c c è s a u x u n it é s d e s to c k a g e C o m m u n ic a ti o n e n tr e u ti lis a te u rs
–T ra n s fe rt d e f ic h ie rs , c o u rr ie r é le c tr o n iq u e E n v ir o n n e m e n t d e p ro g ra m m a ti o n
–C o m p ila te u rs ( C , C + + , F o rt ra n , e tc .)
–E d it e u rs ( E m a c s , V i, e tc .)
N. Gorse –Mar. 2005Introduction àUNIX 4
In tr o d u c ti o n D o c u m e n ta ti o n W e b
–G ild a s P e rr o t
http://www.francenet.fr/~perrot/cours_unix-Contents.html –S é m in a ir e s U N IX d u D IR O
http://www.iro.umontreal.ca/~semunixL iv re
–U N IX
Par D. Taylor et J. C. Armstrong Jr. Collection "Le tout en poche" Campus Press, France2
N. Gorse –Mar. 2005Introduction àUNIX
O rg a n is a ti o n d e l a M a ti è re B a s e s S y s tè m e d e f ic h ie rs M a n ip u la ti o n d e s f ic h ie rs P ro p ri é té s e t d ro it s d 'a c c è s G e s ti o n d e s p ro c e s s u s
N. Gorse –Mar. 2005
B a s e s In tr o d u c ti o n à U N IX N. Gorse –Mar. 2005Introduction àUNIX B a s e s U N IX a u D IR O L o c a u x
–1
eré ta g e : 1 3 4 0 , 3
èmé ta g e : 3 1 8 5 e t 3 1 8 9 C o m p te s e t s u p p o rt
–S e c ré ta ri a t d u d e u x iè m e é ta g e
–h tt p :/ /w w w .i ro .u m o n tr e a l. c a /s u p p o rt S e s s io n s
–L o g in :
–L o g o u t :
N. Gorse –Mar. 2005Introduction àUNIX 8
B a s e s D é c o m p o s it io n S h e ll e t u ti lit a ir e s
–In te rf a c e u s a g e r
–A p p lic a ti o n s N o y a u
–S ys . d ’e x p lo it a ti o n
–G e s ti o n s E /S M a té ri e l
–P ro c e s s e u r
–M é m o ir e
–P é ri p h é ri q u e s
Noyau
Shell & Utilitaires Matériel
N. Gorse –Mar. 2005Introduction àUNIX 9
B a s e s In te rp ré te u r d e C o m m a n d e s C a ra c té ri s ti q u e s
–C o m p a ra b le a u D O S -P ro m p t s o u s w in d o w s
–P e rm e t u n m e ill e u r c o n tr ô le s u r le s a p p lic a ti o n s
–P e rm e t d 'u ti lis e r c e rt a in s o u ti ls n o n g ra p h iq u e s O u v e rt u re d 'u n i n te rp ré te u r (t e rm in a l)
N. Gorse –Mar. 2005Introduction àUNIX 10
B a s e s C o m m a n d e s S y n ta x e
–c o m m a n d e [ o p ti o n s ] < a rg u m e n ts >
–S é p a ra te u r : c a ra c tè re e s p a c e C o m m a n d e
–A c ti o n à a c c o m p lir o u a p p lic a ti o n à d é m a rr e r A rg u m e n ts
–O b je ts o u f ic h ie rs a u x q u e ls l a c o m m a n d e s 'a p p liq u e O p ti o n s
–M o d if ic a ti o n d u c o m p o rt e m e n t d e l a c o m m a n d e
–C o m m e n c e n t g é n é ra le m e n t p a r u n - (m o in s )
N. Gorse –Mar. 2005Introduction àUNIX 1B a s e s E x e m p le s E x e m p le – L a c o m m a n d e l s
–ls : A ff ic h e l a l is te d e s f ic h ie rs e t ré p e rt o ir e s
–ls -l : A ff ic h e u n e l is te d é ta ill é e d e s f ic h ie rs e t ré p e rt o ir e s
–ls -l f ic 1 : A ff ic h e l e s i n fo rm a ti o n s s u r le f ic h ie r fi c 1 s p é c if ié e n p a ra m è tr e T o u t s a v o ir s u r u n e c o m m a n d e : m a n
–m a n < c o m m a n d e >
–A ff ic h e l a p a g e d u m a n u e l s u r la c o m m a n d e c it é e e n a rg u m e n t ( < c o m m a n d e > )
N. Gorse –Mar. 2005
S y s tè m e d e f ic h ie rs In tr o d u c ti o n à U N IX
4
N. Gorse –Mar. 2005Introduction àUNIX
S y s tè m e d e F ic h ie rs H ié ra rc h ie U n e s e u le u n it é d o n t la r a c in e e s t /
–Répertoire actuel:. –Répertoire parent:..N. Gorse –Mar. 2005Introduction àUNIX 14
S y s tè m e d e F ic h ie rs D é fi n it io n s R é p e rt o ir e p ri n c ip a l (H O M E )
–/u /v o tr e lo g in /
–E x . /u /g o rs e n C h e m in a b s o lu d 'u n f ic h ie r (n o m a b s o lu )
–L is te d e s r é p e rt o ir e s t ra v e rs é s p o u r y a c c é d e r
–E x . /u /g o rs e n /H T M L /t e a c h in g /i n d e x .h tm l C h e m in r e la ti f d 'u n f ic h ie r (n o m r e la ti f)
–L is te d e s r é p e rt o ir e s t ra v e rs é s à p a rt ir d u r é p e rt o ir e d a n s l e q u e l o n s e t ro u v e à c e m o m e n t là
–E x . H T M L /t e a c h in g /i n d e x .h tm l
N. Gorse –Mar. 2005Introduction àUNIXS y s tè m e d e F ic h ie rs D é p la c e m e n t p w d
–D o n n e l e c h e m in d u r é p e rt o ir e a c tu e l ( . ) c d
–P e rm e t d e c h a n g e r d e r é p e rt o ir e
twister%twister%twister%twister% cdcdcdcdPhDPhDPhDPhD twister%twister%twister%twister% pwdpwdpwdpwd /u/gorsen/PhD/u/gorsen/PhD/u/gorsen/PhD/u/gorsen/PhDtwistertwistertwistertwister%%%%pwdpwdpwdpwd /u/gorsen/u/gorsen/u/gorsen/u/gorsen twister%twister%twister%twister% cdcdcdcd... twister%twister%twister%twister% pwdpwdpwdpwd /u/gorsen/u/gorsen/u/gorsen/u/gorsen twister%twister%twister%twister% cdcdcdcd/u/gorsen/PhD/u/gorsen/PhD/u/gorsen/PhD/u/gorsen/PhD twister%twister%twister%twister% pwdpwdpwdpwd /u/gorsen/PhD/u/gorsen/PhD/u/gorsen/PhD/u/gorsen/PhD
N. Gorse –Mar. 2005Introduction àUNIX 16
S y s tè m e d e F ic h ie rs L is te s C o m m a n d e : l s
–A ff ic h e l a l is te d e s f ic h ie rs e t ré p e rt o ir e s O p ti o n s c o u ra n te s l s
–-l : a ff ic h a g e d e s f ic h ie rs a v e c l e s c h a m p s s u iv a n ts
Permissions Nombre de références (sous répertoires) Usager Groupe Taille Date de dernière modification Nom –-a : a ff ic h a g e d e s f ic h ie rs c o m m e n ç a n t p a r u n .
N. Gorse –Mar. 2005Introduction àUNIX 7
S y s tè m e d e F ic h ie rs E x e m p le s
hamurabi% pwdhamurabi% pwdhamurabi% pwdhamurabi% pwd /u/gorsen/HTML/u/gorsen/HTML/u/gorsen/HTML/u/gorsen/HTML hamurabi% cdhamurabi% cdhamurabi% cdhamurabi% cd hamurabi% pwdhamurabi% pwdhamurabi% pwdhamurabi% pwd /u/gorsen/u/gorsen/u/gorsen/u/gorsen hamurabi% lshamurabi% lshamurabi% lshamurabi% ls HTML PhD admin archives docs local loisirs progs tmpHTML PhD admin archives docs local loisirs progs tmpHTML PhD admin archives docs local loisirs progs tmpHTML PhD admin archives docs local loisirs progs tmp hamurabi% cd PhD/enseignement/IFThamurabi% cd PhD/enseignement/IFThamurabi% cd PhD/enseignement/IFThamurabi% cd PhD/enseignement/IFT----1214/1214/1214/1214/N. Gorse –Mar. 2005Introduction àUNIX 18
S y s tè m e d e F ic h ie rs E x e m p le s
hamurabi% lshamurabi% lshamurabi% lshamurabi% ls Calendrier.pdfCalendrier.pdfCalendrier.pdfCalendrier.pdfFPNumbers.pptFPNumbers.pptFPNumbers.pptFPNumbers.pptFSM.ppt FSM.ppt FSM.ppt FSM.ppt IntData.pptIntData.pptIntData.pptIntData.pptJavaScriptJavaScriptJavaScriptJavaScriptUnixUnixUnixUnixtttteeeempmpmpmp hamurabi% lshamurabi% lshamurabi% lshamurabi% ls ----llll total 2032total 2032total 2032total 2032 ----rwxrwxrwxrwx---1 gorsen lasso 34639 Oct 7 20:46 Calendrier.pdf1 gorsen lasso 34639 Oct 7 20:46 Calendrier.pdf1 gorsen lasso 34639 Oct 7 20:46 Calendrier.pdf1 gorsen lasso 34639 Oct 7 20:46 Calendrier.pdf ----rwxrwxrwxrwx---1 gorsen lasso 480256 Oct 1 14:44 FPNumbers.ppt1 gorsen lasso 480256 Oct 1 14:44 FPNumbers.ppt1 gorsen lasso 480256 Oct 1 14:44 FPNumbers.ppt1 gorsen lasso 480256 Oct 1 14:44 FPNumbers.ppt ----rwxrwxrwxrwx---1 gorsen lasso 154112 Oct 1 14:44 FSM.ppt1 gorsen lasso 154112 Oct 1 14:44 FSM.ppt1 gorsen lasso 154112 Oct 1 14:44 FSM.ppt1 gorsen lasso 154112 Oct 1 14:44 FSM.ppt ----rwxrwxrwxrwx---1 gorsen lasso 1378816 Sep 29 07:25 IntData.ppt1 gorsen lasso 1378816 Sep 29 07:25 IntData.ppt1 gorsen lasso 1378816 Sep 29 07:25 IntData.ppt1 gorsen lasso 1378816 Sep 29 07:25 IntData.ppt drwxdrwxdrwxdrwx---4 gorsen lasso 4096 Oct 18 11:21 JavaScript4 gorsen lasso 4096 Oct 18 11:21 JavaScript4 gorsen lasso 4096 Oct 18 11:21 JavaScript4 gorsen lasso 4096 Oct 18 11:21 JavaScript drwxdrwxdrwxdrwx---2 gorsen lasso 4096 Oct 19 13:07 Unix2 gorsen lasso 4096 Oct 19 13:07 Unix2 gorsen lasso 4096 Oct 19 13:07 Unix2 gorsen lasso 4096 Oct 19 13:07 Unix drwxdrwxdrwxdrwx---4 gorsen lasso 4096 Oct 16 10:05 t4 gorsen lasso 4096 Oct 16 10:05 t4 gorsen lasso 4096 Oct 16 10:05 t4 gorsen lasso 4096 Oct 16 10:05 teeeempmpmpmp N. Gorse –Mar. 2005Introduction àUNIX 9S y s tè m e d e F ic h ie rs P a rt ic u la ri té s Id e n ti fi c a ti o n v ia l a c o m m a n d e ls -l
–L e s ig n e - d é s ig n e u n f ic h ie r
–L a l e tt re d d é s ig n e u n r é p e rt o ir e
–L a l e tt re l d é s ig n e u n l ie n N o m s d e f ic h ie rs e t ré p e rt o ir e s
–L im it é s à 2 5 5 c a ra c tè re s
–T o u s l e s c a ra c tè re s s p é c ia u x ( * , ( , % , e tc .) s o n t p e rm is , o n u ti lis e ra a lo rs l e s g u ill e m e ts "" p o u r e n v e lo p p e r le n o m d u f ic h ie r o u l e c a ra c tè re \ d e v a n t c h a q u e c a ra c tè re s p é c ia l.
N. Gorse –Mar. 2005
M a n ip u la ti o n d e s F ic h ie rs In tr o d u c ti o n à U N IX
6
N. Gorse –Mar. 2005Introduction àUNIX
M a n ip . d e s F ic h ie rs C o m m a n d e s C ré a ti o n
–m k d ir re p 1 : C ré a ti o n d u r é p e rt o ir e v id e re p 1
–to u c h fi c 1 : C ré a ti o n d u f ic h ie r v id e fi c 1 S u p p re s s io n
–rm d ir re p 1 : S u p p re s s io n d u r é p e rt o ir e re p 1
–rm fi c 1 : S u p p re s s io n d u f ic h ie r fi c 1
–O p ti o n s d e r m
-i : Confirmation de suppression -f : Retrait de tout genre de confirmation -r : Suppression récursive (répertoires) -rf: Combinaison : suppressionrécursive sans confirmationN. Gorse –Mar. 2005Introduction àUNIX 22
M a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 0total 0total 0total 0 hamurabihamurabihamurabihamurabi% % % % mkdirmkdirmkdirmkdirrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % touchtouchtouchtouchfic1fic1fic1fic1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 ----rwrwrwrw---1 gorsen lasso 01 gorsen lasso 01 gorsen lasso 01 gorsen lasso 0 OctOctOctOct19 13:56 fic119 13:56 fic119 13:56 fic119 13:56 fic1 drwxdrwxdrwxdrwx---2 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% % % % rmdirrmdirrmdirrmdirrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 ----rwrwrwrw---1 gorsen lasso 01 gorsen lasso 01 gorsen lasso 01 gorsen lasso 0 OctOctOctOct19 13:56 fic119 13:56 fic119 13:56 fic119 13:56 fic1 hamurabihamurabihamurabihamurabi% % % % rmrmrmrm----i fic1i fic1i fic1i fic1 rmrmrmrm: : : : removeremoveremoveremoveregularregularregularregularemptyemptyemptyemptyfile `fic1'? yfile `fic1'? yfile `fic1'? yfile `fic1'? y N. Gorse –Mar. 2005Introduction àUNIXM a n ip . d e s F ic h ie rs C o m m a n d e s C o p ie
–c p a a a b b b : C o p ie a a a e n b b b s i b b b n 'e s t p a s u n ré p e rt o ir e , s in o n , c o p ie a a a d a n s b b b
–S i b b b e s t u n f ic h ie r d é jà e x is ta n t, i l s e ra r e m p la c é p a r la c o p ie d e a a a
–O p ti o n s d e c p
-i : Confirmation de copie -f : Retrait de tout genre de confirmation -r : Copie récursive (répertoires) -rf: Combinaison : copierécursive sans confirmationN. Gorse –Mar. 2005Introduction àUNIX 24
M a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % mkdirmkdirmkdirmkdirrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % touchtouchtouchtouchfic1fic1fic1fic1 hamurabihamurabihamurabihamurabi% % % % cpcpcpcpfic1 fic2fic1 fic2fic1 fic2fic1 fic2 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 ----rwrwrwrw---1 gorsen lasso 01 gorsen lasso 01 gorsen lasso 01 gorsen lasso 0 OctOctOctOct19 13:56 fic119 13:56 fic119 13:56 fic119 13:56 fic1 ----rwrwrwrw---1 gorsen lasso 01 gorsen lasso 01 gorsen lasso 01 gorsen lasso 0 OctOctOctOct19 13:56 fic219 13:56 fic219 13:56 fic219 13:56 fic2 drwdrwdrwdrw---1 gorsen lasso 40961 gorsen lasso 40961 gorsen lasso 40961 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% % % % cpcpcpcpfic2 rep1fic2 rep1fic2 rep1fic2 rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----l rep1l rep1l rep1l rep1 total 0total 0total 0total 0 ----rwrwrwrw---1 gorsen lasso 01 gorsen lasso 01 gorsen lasso 01 gorsen lasso 0 OctOctOctOct19 13:56 fic219 13:56 fic219 13:56 fic219 13:56 fic2N. Gorse –Mar. 2005Introduction àUNIX 5
M a n ip . d e s F ic h ie rs C o m m a n d e s D é p la c e m e n t
–m v a a a b b b : R e n o m m e a a a e n b b b s i b b b n 'e s t p a s u n r é p e rt o ir e , s in o n , d é p la c e a a a d a n s b b b
–S i b b b e s t u n f ic h ie r d é jà e x is ta n t, i l s e ra r e m p la c é p a r a a a lo rs q u e c e lu i- c i s e ra r e n o m m é
–O p ti o n s d e m v
-i : confirmation de déplacement -f : retrait de tout genre de confirmationE s p a c e
–d u a a a : D o n n e l 'e s p a c e o c c u p é p a r a a a
N. Gorse –Mar. 2005Introduction àUNIX 26
M a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % mkdirmkdirmkdirmkdirrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % touchtouchtouchtouchfic1fic1fic1fic1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 ----rwrwrwrw---1 gorsen lasso 01 gorsen lasso 01 gorsen lasso 01 gorsen lasso 0 OctOctOctOct19 13:56 fic119 13:56 fic119 13:56 fic119 13:56 fic1 drwxdrwxdrwxdrwx---2 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% % % % mvmvmvmvfic1 rep1fic1 rep1fic1 rep1fic1 rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 drwxdrwxdrwxdrwx---2 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----l rep1l rep1l rep1l rep1 total 0total 0total 0total 0 ----rwrwrwrw---1 gorsen lasso 01 gorsen lasso 01 gorsen lasso 01 gorsen lasso 0 OctOctOctOct19 13:56 fic119 13:56 fic119 13:56 fic119 13:56 fic1 N. Gorse –Mar. 2005Introduction àUNIX 7M a n ip . d e s F ic h ie rs C o m m a n d e s R e c h e rc h e d 'u n f ic h ie r
–fi n d < p o in t d e d é p a rt > - n a m e < fi c h ie r> : R e c h e rc h e l e s o c c u rr e n c e s d u f ic h ie r d o n t le n o m e s t d o n n é e n p a ra m è tr e d a n s l 'a rb o re s c e n c e s e tr o u v a n t s o u s l e p o in t d e d é p a rt s p é c if ié L e c tu re d u c o n te n u d 'u n f ic h ie r
–c a t fi c : A ff ic h e l e c o n te n u d u f ic h ie r fi c L e c tu re d u c o n te n u d 'u n f ic h ie r p a s à p a s
–m o re f ic : A ff ic h e l e c o n te n u d e fi c p a g e p a r p a g e
Prochaine page : presser la barre d'espace Prochaine ligne : presser la touche [enter]N. Gorse –Mar. 2005Introduction àUNIX 28
M a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % mkdirmkdirmkdirmkdirrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % cdcdcdcdrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % mkdirmkdirmkdirmkdirrep2rep2rep2rep2 hamurabihamurabihamurabihamurabi% % % % touchtouchtouchtouchficficficfic hamurabihamurabihamurabihamurabi% % % % cdcdcdcdrep2rep2rep2rep2 hamurabihamurabihamurabihamurabi% % % % mkdirmkdirmkdirmkdirrep3rep3rep3rep3 hamurabihamurabihamurabihamurabi% % % % touchtouchtouchtouchficficficfic hamurabihamurabihamurabihamurabi% % % % cdcdcdcd../../../../../../../../ hamurabihamurabihamurabihamurabi% % % % findfindfindfindrep1rep1rep1rep1 ––––namenamenamenameficficficfic rep1/rep2/ficrep1/rep2/ficrep1/rep2/ficrep1/rep2/fic rep1/ficrep1/ficrep1/ficrep1/fic8
N. Gorse –Mar. 2005Introduction àUNIX
M a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 drwxdrwxdrwxdrwx---2 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 ----rwrwrwrw---1 gorsen lasso 441 gorsen lasso 441 gorsen lasso 441 gorsen lasso 44 OctOctOctOct19 13:56 texte19 13:56 texte19 13:56 texte19 13:56 texte hamurabihamurabihamurabihamurabi% % % % catcatcatcattextetextetextetexte ceci est le contenuceci est le contenuceci est le contenuceci est le contenu du fichierdu fichierdu fichierdu fichier sur 3 lignessur 3 lignessur 3 lignessur 3 lignes hamurabihamurabihamurabihamurabi% % % % cdcdcdcdrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 drwxdrwxdrwxdrwx---2 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 40962 gorsen lasso 4096 OctOctOctOct19 13:56 rep219 13:56 rep219 13:56 rep219 13:56 rep2 ----rwrwrwrw---1 gorsen lasso 01 gorsen lasso 01 gorsen lasso 01 gorsen lasso 0 OctOctOctOct19 13:56 fic19 13:56 fic19 13:56 fic19 13:56 fic hamurabihamurabihamurabihamurabi% % % % catcatcatcatficficficficN. Gorse –Mar. 2005Introduction àUNIX 30
M a n ip . d e s F ic h ie rs C o m m a n d e s A ff ic h a g e d 'u n c h a m p p a rt ic u lie r
–L a c o m m a n d e c u t p e rm e t d e f ilt re r d u t e x te p o u r n 'a ff ic h e r q u e c e rt a in s c h a m p s d é s ir é s
–C o m m a n d e : c u t -d < d é li m it e u r> - f< c h a m p >
Délimiteur : caractère délimitant les différents champs Champ : numéro de champ désiré –U ti lis a ti o n
cut-d<delimiteur> -f<champ> fichier catfichier | cut-d<delimiteur> -f<champ> –C h a m p s
Un seul : un seul numéro Plusieurs : liste de numéros séparés par une virgule N. Gorse –Mar. 2005Introduction àUNIXM a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % catcatcatcattextetextetextetexte login:login:login:login:prenomprenomprenomprenom:nom::nom::nom::nom:departementdepartementdepartementdepartement:cours:cours:cours:cours gorsen:gorsen:gorsen:gorsen:nicolasnicolasnicolasnicolas::::gorsegorsegorsegorse::::dirodirodirodiro:ift1214:ift1214:ift1214:ift1214 aboulhamaboulhamaboulhamaboulham::::mostaphamostaphamostaphamostapha::::aboulhamidaboulhamidaboulhamidaboulhamid::::dirodirodirodiro:ift1214:ift1214:ift1214:ift1214 hamurabihamurabihamurabihamurabi% % % % catcatcatcattexte | texte | texte | texte | cutcutcutcut----d:d:d:d:----f1f1f1f1 loginloginloginlogin gorsengorsengorsengorsen aboulhamaboulhamaboulhamaboulham hamurabihamurabihamurabihamurabi% % % % catcatcatcattexte | texte | texte | texte | cutcutcutcut----d:d:d:d:----f1,5f1,5f1,5f1,5 login:courslogin:courslogin:courslogin:cours gorsen:ift1214gorsen:ift1214gorsen:ift1214gorsen:ift1214 aboulhamaboulhamaboulhamaboulham:ift1214:ift1214:ift1214:ift1214N. Gorse –Mar. 2005Introduction àUNIX 32
M a n ip . d e s F ic h ie rs C o m m a n d e s A ff ic h a g e d u d é b u t d 'u n f ic h ie r
–L a c o m m a n d e h e a d a ff ic h e l e s 1 0 p re m iè re s l ig n e s d 'u n f ic h ie r te x te d o n n é e n p a ra m è tr e
–L a c o m m a n d e h e a d -n 3 a ff ic h e ra s e u le m e n t le s tr o is p re m iè re s l ig n e s A ff ic h a g e d e l a f in d 'u n f ic h ie r
–L a c o m m a n d e ta il a ff ic h e l e s 1 0 d e rn iè re s l ig n e s d 'u n f ic h ie r d o n n é e n p a ra m è tr e
–L a c o m m a n d e ta il -n 3 a ff ic h e ra s e u le m e n t le s t ro is d e rn iè re s l ig n e s L a c o m b in a is o n d e s d e u x e s t p a rf o is u ti le
N. Gorse –Mar. 2005Introduction àUNIX 3
M a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % catcatcatcattextetextetextetexte login:login:login:login:prenomprenomprenomprenom:nom::nom::nom::nom:departementdepartementdepartementdepartement:cours:cours:cours:cours gorsen:gorsen:gorsen:gorsen:nicolasnicolasnicolasnicolas::::gorsegorsegorsegorse::::dirodirodirodiro:ift1214:ift1214:ift1214:ift1214 aboulhamaboulhamaboulhamaboulham::::mostaphamostaphamostaphamostapha::::aboulhamidaboulhamidaboulhamidaboulhamid::::dirodirodirodiro:ift1214:ift1214:ift1214:ift1214 hamurabihamurabihamurabihamurabi% % % % headheadheadhead----n 1 texten 1 texten 1 texten 1 texte login:login:login:login:prenomprenomprenomprenom:nom::nom::nom::nom:departementdepartementdepartementdepartement:cours:cours:cours:cours hamurabihamurabihamurabihamurabi% % % % tailtailtailtail----n 1 texten 1 texten 1 texten 1 texte aboulhamaboulhamaboulhamaboulham::::mostaphamostaphamostaphamostapha::::aboulhamidaboulhamidaboulhamidaboulhamid::::dirodirodirodiro:ift1214:ift1214:ift1214:ift1214 hamurabihamurabihamurabihamurabi% % % % tailtailtailtail----n 2 texte |n 2 texte | n 2 texte | n 2 texte | headheadheadhead----n 1n 1n 1n 1 gorsen:gorsen:gorsen:gorsen:nicolasnicolasnicolasnicolas::::gorsegorsegorsegorse::::dirodirodirodiro:ift1214:ift1214:ift1214:ift1214 hamurabihamurabihamurabihamurabi% % % % tailtailtailtail----n 2 texte |n 2 texte | n 2 texte | n 2 texte | headheadheadhead----n 1 |n 1 | n 1 | n 1 | cutcutcutcut----d: d:d:d: ----f2f2f2f2 nicolasnicolasnicolasnicolasN. Gorse –Mar. 2005Introduction àUNIX 34
M a n ip . d e s F ic h ie rs C o m m a n d e s A rc h iv a g e
–ta r -c v f b b b .t a r a a a : A rc h iv e l e c o n te n u d u re p e rt o ir e a a a d a n s l e f ic h ie r b b b .t a r
–ta r -x v f b b b .t a r : E x tr a it l e c o n te n u d e l 'a rc h iv e b b b .t a r e t le p la c e d a n s l e r é p e rt o ir e c o u ra n t C o m p re s s io n
–g z ip fi c : C o m p re s s e l e f ic h ie r fi c q u i s e ra re n o m m é e n fi c .g z
–g z ip -d f ic .g z : D é c o m p re s s e l e f ic h ie r fi c .g z q u i s e ra r e n o m m é e n fi c
N. Gorse –Mar. 2005Introduction àUNIX 5M a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % tartartartar----cvfcvfcvfcvfarch.tar rep1arch.tar rep1arch.tar rep1arch.tar rep1 rep1/rep1/rep1/rep1/ rep1/rep2rep1/rep2rep1/rep2rep1/rep2 rep1/rep2/rep3rep1/rep2/rep3rep1/rep2/rep3rep1/rep2/rep3 rep1/rep2/ficrep1/rep2/ficrep1/rep2/ficrep1/rep2/fic rep1/ficrep1/ficrep1/ficrep1/fic hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 20total 20total 20total 20 drwxdrwxdrwxdrwx---3 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 ----rwrwrwrw---1 gorsen lasso 102401 gorsen lasso 102401 gorsen lasso 102401 gorsen lasso 10240 OctOctOctOct19 13:5619 13:5619 13:5619 13:56 arch.tararch.tararch.tararch.tar hamurabihamurabihamurabihamurabi% % % % gzipgzipgzipgziparch.tararch.tararch.tararch.tar hamurabihamurabihamurabihamurabi% % % % lslslsls––––llll total 20total 20total 20total 20 drwxdrwxdrwxdrwx---3 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 ----rwrwrwrw---1 gorsen lasso 2041 gorsen lasso 2041 gorsen lasso 2041 gorsen lasso 204 OctOctOctOct19 13:5619 13:5619 13:5619 13:56 arch.tar.gzarch.tar.gzarch.tar.gzarch.tar.gzN. Gorse –Mar. 2005Introduction àUNIX 36
M a n ip . d e s F ic h ie rs C o m m a n d e s F ilt re s
–s o rt a a a : A ff ic h e l e c o n te n u d u f ic h ie r a a a e n t ri a n t le s l ig n e s p a r o rd re a lp h a b é ti q u e
–w c a a a : C o m p te l e n o m b re d e l ig n e s , d e m o ts e t d e l e tt re s c o n te n u s d a n s l e f ic h ie r a a a R e d ir e c ti o n d 'E /S
–w c a a a > c o m p te .t x t : R e d ir ig e l a s o rt ie d e l a c o m m a n d e w c a a a d a n s l e f ic h ie r c o m p te .t x t
–c a t a a a | m o re : R e d ir ig e l a s o rt ie d e l a c o m m a n d e c a t a a a d a n s l 'e n tr é e d e l a c o m m a n d e m o re
–w c < a a a : U ti lis e a a a c o m m e e n tr é e p o u r w c
1 0
N. Gorse –Mar. 2005Introduction àUNIX
M a n ip . d e s F ic h ie rs E x e m p le s
hamurabihamurabihamurabihamurabi% % % % wcwcwcwctextetextetextetexte 3 9 44 texte3 9 44 texte3 9 44 texte3 9 44 texte hamurabihamurabihamurabihamurabi% % % % wcwcwcwctexte > texte > texte > texte > compte.txtcompte.txtcompte.txtcompte.txt hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 20total 20total 20total 20 drwxdrwxdrwxdrwx---3 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 ----rwrwrwrw---1 gorsen lasso 441 gorsen lasso 441 gorsen lasso 441 gorsen lasso 44 OctOctOctOct19 13:56 texte19 13:56 texte19 13:56 texte19 13:56 texte ----rwrwrwrw---1 gorsen lasso 301 gorsen lasso 301 gorsen lasso 301 gorsen lasso 30 OctOctOctOct19 13:5619 13:5619 13:5619 13:56 compte.txtcompte.txtcompte.txtcompte.txt hamurabihamurabihamurabihamurabi% % % % catcatcatcatcompte.txtcompte.txtcompte.txtcompte.txt 3 9 44 texte3 9 44 texte3 9 44 texte3 9 44 texte hamurabihamurabihamurabihamurabi% % % % wcwcwcwc< texte< texte< texte< texte 3 9 443 9 443 9 443 9 44N. Gorse –Mar. 2005Introduction àUNIX 38
M a n ip . d e s F ic h ie rs ? e t * ?
–R e m p la c e u n c a ra c tè re d a n s u n n o m d e f ic h ie r d o n n é e n a rg u m e n t à u n e c o m m a n d e
–ls fi c ? : D o n n e l a l is te d e s f ic h ie rs d o n t le n o m a e x a c te m e n t 4 l e tt re s e t c o m m e n c e p a r fi c *
–S ig n if ie z é ro , o u u n e i n fi n it é d e c a ra c tè re s d a n s u n n o m d e f ic h ie r d o n n é e n a rg u m e n t à u n e c o m m a n d e
–ls fi c * : D o n n e l a l is te d e s f ic h ie rs d o n t le n o m a 3 le tt re s o u p lu s e t c o m m e n c e p a r fi c
N. Gorse –Mar. 2005P ro p ri é té s e t D ro it s d 'A c c è s In tr o d u c ti o n à U N IX
N. Gorse –Mar. 2005Introduction àUNIX 40
P ro p . e t D ro it s d 'A c c è s P ro p ri é té A p p a rt e n a n c e d 'u n f ic h ie r
–U s a g e r
–G ro u p e
–id : D o n n e l 'id e n ti fi c a te u r d 'u s a g e r (u id ), l e g ro u p e p ri n c ip a l (g id ) e t le s g ro u p e s s e c o n d a ir e s q u i s o n t a s s o c ié s à u n u s a g e r
hamurabihamurabihamurabihamurabi% id gorsen% id gorsen% id gorsen% id gorsen uiduiduiduid=16849(=16849(=16849(=16849(gorsengorsengorsengorsen) ) ) ) gidgidgidgid=309(=309(=309(=309(lassolassolassolasso) groups=309() groups=309() groups=309() groups=309(lassolassolassolasso),806(gift0012)),806(gift0012)),806(gift0012)),806(gift0012) hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 ----rwrwrwrw---1 1 1 1 gorsengorsengorsengorsenlassolassolassolasso0 Oct 19 14:03 fic10 Oct 19 14:03 fic10 Oct 19 14:03 fic10 Oct 19 14:03 fic1 drwxdrwxdrwxdrwx---2 2 2 2 gorsengorsengorsengorsenlassolassolassolasso4096 Oct 19 14:07 rep14096 Oct 19 14:07 rep14096 Oct 19 14:07 rep14096 Oct 19 14:07 rep1N. Gorse –Mar. 2005Introduction àUNIX 1
P ro p . e t D ro it s d 'A c c è s C h a m p s Q u a tr e c h a m p s
–T yp e
d : Répertoire -: Fichier l : Lien –P e rm is s io n s d u p ro p ri é ta ir e
–P e rm is s io n s d u g ro u p e
–P e rm is s io n s d e s a u tr e s
hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 ----rwrwrwrw---1 gorsen lasso 0 Oct 19 14:03 fic11 gorsen lasso 0 Oct 19 14:03 fic11 gorsen lasso 0 Oct 19 14:03 fic11 gorsen lasso 0 Oct 19 14:03 fic1 ddddrwxrwxrwxrwx---2 gorsen lasso 4096 Oct 19 14:07 rep12 gorsen lasso 4096 Oct 19 14:07 rep12 gorsen lasso 4096 Oct 19 14:07 rep12 gorsen lasso 4096 Oct 19 14:07 rep1N. Gorse –Mar. 2005Introduction àUNIX 42
P ro p . e t D ro it s d 'A c c è s D ro it s T ro is c h a m p s p o u r c h a q u e c a té g o ri e
–L e c tu re
r pour signifier l'autorisation, -pour signifier l'interdiction –E c ri tu re
w pour signifier l'autorisation, -pour signifier l'interdiction –E x é c u ti o n
x pour signifier l'autorisation, -pour signifier l'interdiction hamurabihamurabihamurabihamurabi% % % % lslslsls----llll total 4total 4total 4total 4 ----rwrwrwrw----rrrr---rrrr---1 gorsen lasso 0 Oct 19 14:03 fic11 gorsen lasso 0 Oct 19 14:03 fic11 gorsen lasso 0 Oct 19 14:03 fic11 gorsen lasso 0 Oct 19 14:03 fic1 ddddrwxrwxrwxrwxrrrr----xxxx---xxxx2 gorsen lasso 4096 Oct 19 14:07 rep12 gorsen lasso 4096 Oct 19 14:07 rep12 gorsen lasso 4096 Oct 19 14:07 rep12 gorsen lasso 4096 Oct 19 14:07 rep1 N. Gorse –Mar. 2005Introduction àUNIX 3P ro p . e t D ro it s d 'A c c è s E x e m p le s -r w -r -- r- -
–F ic h ie r
–L e c tu re e t é c ri tu re p o u r le p ro p ri é ta ir e
–L e c tu re s e u le m e n t p o u r le g ro u p e e t le s a u tr e s d rw -r -x r- x
–R é p e rt o ir e
–L e c tu re e t é c ri tu re p o u r le p ro p ri é ta ir e
–L e c tu re e t e x é c u ti o n p o u r le g ro u p e e t le s a u tr e s
–A tt e n ti o n : L e p ro p ri é ta ir e n 'a p a s l e d ro it d 'e n tr e r d a n s l e r é p e rt o ir e e n q u e s ti o n
N. Gorse –Mar. 2005Introduction àUNIX 44
P ro p . e t D ro it s d 'A c c è s c h m o d c h m o d : M o d if ic a ti o n d e s d ro it s d 'a c c è s s u r u n fi c h ie r o u u n r é p e rt o ir e
–U ti lis a ti o n c h m o d < q u i> < + /- > < d ro it > f ic h ie r
qui:u–usager (propriétaire) g–groupe o–autres a–all(tout le monde : u, g et o) +/-:ajout (+) ou retrait (-) de la permission droit:r–droit de lecture w–droit d'écriture x–droit d'exécution –L e s u s a g e rs e t p e rm is s io n s p e u v e n t ê tr e c o m b in é s
1 2
N. Gorse –Mar. 2005Introduction àUNIX
P ro p . e t D ro it s d 'A c c è s E x e m p le s
hamurabihamurabihamurabihamurabi% % % % lslslsls----llll Total 2Total 2Total 2Total 2 d d d d rwxrwxrwxrwx---wxwxwxwx3 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% chmod g+x rep1% chmod g+x rep1% chmod g+x rep1% chmod g+x rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll Total 2Total 2Total 2Total 2 d d d d rwxrwxrwxrwx---x x x x ----wxwxwxwx3 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% chmod % chmod % chmod % chmod uouououo----wwwwrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll Total 2Total 2Total 2Total 2 d d d d rrrr----xxxx---x x x x ---x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1N. Gorse –Mar. 2005Introduction àUNIX 46
P ro p . e t D ro it s d 'A c c è s c h m o d U ti lis a ti o n d e s c o m b in a is o n s d e c h if fr e s
–c h m o d < A B C > f ic
A, B et C–Chiffres codant les droits A–Droits pour l'usager (propriétaire) B–Droits pour le groupe C–Droits pour les autres –P ri n c ip e
Un bit par permission : –r = bit 2 –w = bit 1 –x = bit 0 Valeur : 1 si la permission est présente, 0 sinon Le nombre binaire obtenu est ensuite traduit en décimal N. Gorse –Mar. 2005Introduction àUNIXP ro p . e t D ro it s d 'A c c è s E x e m p le s
hamurabihamurabihamurabihamurabi% % % % lslslsls----llll Total 2Total 2Total 2Total 2 d d d d rwxrwxrwxrwx---wxwxwxwx3 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% chmod 710 rep1% chmod 710 rep1% chmod 710 rep1% chmod 710 rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll Total 2Total 2Total 2Total 2 d d d d rwxrwxrwxrwx---x x x x ---3 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% chmod 511 rep1% chmod 511 rep1% chmod 511 rep1% chmod 511 rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll Total 2Total 2Total 2Total 2 d d d d rrrr----xxxx---x x x x ---x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1N. Gorse –Mar. 2005Introduction àUNIX 48
P ro p . e t D ro it s d 'A c c è s c h m o d U ti lis a ti o n d e s d ro it s r e la ti fs
–c h m o d < q u i> = < re f> < + /- > < d ro it s > f ic h ie r
<ref>représente le champ auquel on fait référence pour établir les droits sur les autres champs (<qui>)E x e m p le
hamurabihamurabihamurabihamurabi% % % % lslslsls----llll Total 2Total 2Total 2Total 2 d d d d rwxrwxrwxrwx---wxwxwxwx3 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 40963 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1 hamurabihamurabihamurabihamurabi% chmod go=% chmod go=% chmod go=% chmod go=uuuu----rwrwrwrwrep1rep1rep1rep1 hamurabihamurabihamurabihamurabi% % % % lslslsls----llll Total 2Total 2Total 2Total 2 d d d d rwxrwxrwxrwx---x x x x ---x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 x 3 gorsen lasso 4096 OctOctOctOct19 13:56 rep119 13:56 rep119 13:56 rep119 13:56 rep1N. Gorse –Mar. 2005Introduction àUNIX 9
P ro p . e t D ro it s d 'A c c è s c h m o d E x e m p le s p e rm is s io n s / c o d e
–p e rm is s io n s : rw - r- - r- -
–C o d e : 6 4 4
–p e rm is s io n s : -- x -- x -- -
–C o d e : 1 1 0 R é c u rs iv it é
–c h m o d - R g o = u -w re p 1
–D o n n e a u g ro u p e e t a u x a u tr e s l e s m ê m e s d ro it s q u 'a u p ro p ri é ta ir e ( m is à p a rt l e d ro it e n é c ri tu re ) s u r le r é p e rt o ir e re p 1 e t to u s l e s s o u s r é p e rt o ir e s e t fi c h ie rs d e c e r é p e rt o ir e
N. Gorse –Mar. 2005
G e s ti o n d e s P ro c e s s u s In tr o d u c ti o n à U N IX N. Gorse –Mar. 2005Introduction àUNIX 1
G e s ti o n d e s P ro c e s s u s In tr o d u c ti o n U n e t â c h e e s t e ff e c tu é e p a r u n p ro c e s s u s L e l a n c e m e n t d 'u n e n o u v e lle t â c h e e n g e n d re la c ré a ti o n d 'u n p ro c e s s u s
–C o m m a n d e t a p é e p a r l'u ti lis a te u r
–T â c h e l a n c é e p a r u n p ro c e s s u s d é jà e x is ta n t U N IX e s t m u lt it â c h e
–L e s t â c h e s s o n t e x é c u té e s e n p a ra llè le
–C h a q u e t â c h e r e ç o it l 'u s a g e d u p ro c e s s e u r d u ra n t u n c o u rt l a p s d e t e m p s ( e n v . 1 /1 0 0 s e c )
–L a d is tr ib u ti o n e s t g é ré e p a r u n o rd o n n a n c e u r
N. Gorse –Mar. 2005Introduction àUNIX 52
G e s ti o n d e s P ro c e s s u s D é fi n it io n s P ro c e s s u s ( jo b , tâ c h e , p ro g ra m m e )
–U n it é d 'e x é c u ti o n
–T o u te a c ti o n e s t e x é c u té e p a r u n p ro c e s s u s
–C a ra c té ri s ti q u e s
Identifiépar un numéro unique : PID (ProcessID) Possède son propre environnement Peut être dans différents étatsT h re a d (F il)
–U n it é p lu s l é g è re
–P e rm e t d e t ra it e r p lu s ie u rs s o u s t â c h e s p a rt a g e a n t le m ê m e e s p a c e m é m o ir e
1 4
N. Gorse –Mar. 2005Introduction àUNIX
G e s ti o n d e s P ro c e s s u s D é fi n it io n s C o m p o s it io n d e l 'im a g e d 'u n p ro c e s s u s
–C o d e
–D o n n é e s a s s o c ié e s ( tr a it é e s p a r le c o d e )
–F ic h ie rs o u v e rt s e t le u r é ta t
–R é p e rt o ir e c o u ra n t
–In fo rm a ti o n s d u s ys tè m e s u r le p ro c e s s u s
Propriétaire Terminal associé Etat Priorité Etc.N. Gorse –Mar. 2005Introduction àUNIX 54
G e s ti o n d e s P ro c e s s u s C ré a ti o n L a n c e m e n t d 'u n e n o u v e lle t â c h e C ré a ti o n p a r u n a u tr e p ro c e s s u s
–H ié ra rc h ie : P è re , fi ls
–A rb re d e p ro c e s s u s Q u e s ti o n ( d if fé re n te s s o lu ti o n s s u iv a n t S E )
–U n p ro c e s s u s p è re d o it c o n ti n u e r s o n e x é c u ti o n p e n d a n t l’e x is te n c e d e s p ro c e s s u s f ils e t d o it l e s g é re r d e q u e lq u e f a ç o n
–P è re e t fi ls s o n t in d é p e n d a n ts e t le p è re p e u t d is p a ra ît re e n l a is s a n t s e s f ils l iv ré s à e u x -m ê m e s
N. Gorse –Mar. 2005Introduction àUNIXG e s ti o n d e s P ro c e s s u s T e rm in a is o n D e rn iè re i n s tr u c ti o n e x é c u té e R é c e p ti o n d 'u n s ig n a l d 'a rr ê t v e n a n t :
–D u p ro p ri é ta ir e
–D e l 'a d m in is tr a te u r T e rm in a is o n d e l 'e x é c u ti o n p a r s o n p è re
–D if fé re n te s r a is o n s p o s s ib le s
Le fils a épuiséses ressources Le fils n'est plus requis Etc.N o te : U n f ils p e u t tu e r s o n p è re
N. Gorse –Mar. 2005Introduction àUNIX 56