Académique Documents
Professionnel Documents
Culture Documents
2003
Introduction Historique
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
Organisation de la Matire
z Bases Bases
z Systme de fichiers
z Manipulation des fichiers
z Proprits et droits d'accs
z Aspects rseau Introduction UNIX
z Gestion des processus
z Grep et expressions rgulires
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
z Caractristiques z Syntaxe
Comparable au DOS-Prompt sous windows commande [options] <arguments>
Permet un meilleur contrle sur les applications Sparateur : caractre espace
Permet d'utiliser certains outils non graphiques z Commande
Action accomplir ou application dmarrer
z Ouverture d'un interprteur (terminal)
z Arguments
Objets ou fichiers auxquels la commande s'applique
z Options
Modification du comportement de la commande
Commencent gnralement par un - (moins)
9 10
Bases Exemples
11
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
z pwd z Commande : ls
Donne le chemin du rpertoire actuel (.) Affiche la liste des fichiers et rpertoires
twister% pwd z Options courantes ls
/u/gorsen
-l : affichage des fichiers avec les champs suivants
z cd z Permissions
Permet de changer de rpertoire z Nombre de rfrences (sous rpertoires)
z Usager
twister% cd PhD twister% cd /u/gorsen/PhD
z Groupe
twister% pwd twister% pwd
/u/gorsen/PhD /u/gorsen/PhD z Taille
z Date de dernire modification
twister% cd ..
z Nom
twister% pwd
/u/gorsen -a : affichage des fichiers commenant par un .
15 16
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
17 18
19
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
z Cration hamurabi% ls -l
total 0
mkdir rep1 : Cration du rpertoire vide rep1
touch fic1 : Cration du fichier vide fic1 hamurabi% mkdir rep1
hamurabi% touch fic1
hamurabi% ls -l
z Suppression total 4
rmdir rep1 : Suppression du rpertoire rep1 -rw------- 1 gorsen lasso 0 Oct 19 13:56 fic1
drwx------ 2 gorsen lasso 4096 Oct 19 13:56 rep1
rm fic1 : Suppression du fichier fic1
Options de rm hamurabi% rmdir rep1
hamurabi% ls -l
z -i : Confirmation de suppression total 4
z -f : Retrait de tout genre de confirmation -rw------- 1 gorsen lasso 0 Oct 19 13:56 fic1
z -r : Suppression rcursive (rpertoires)
hamurabi% rm -i fic1
z -rf : Combinaison : suppression rcursive sans confirmation rm: remove regular empty file `fic1'? y
21 22
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
23 24
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
25 26
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
27 28
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
33 34
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
hamurabi% wc texte z ?
3 9 44 texte
Remplace un caractre dans un nom de fichier
hamurabi% wc texte > compte.txt donn en argument une commande
hamurabi% ls -l
total 20 ls fic? : Donne la liste des fichiers dont le nom a
drwx------ 3 gorsen lasso 4096 Oct 19 13:56 rep1 exactement 4 lettres et commence par fic
-rw------- 1 gorsen lasso 44 Oct 19 13:56 texte
-rw------- 1 gorsen lasso 30 Oct 19 13:56 compte.txt z *
hamurabi% cat compte.txt Signifie zro, ou une infinit de caractres dans un
3 9 44 texte nom de fichier donn en argument une commande
hamurabi% wc < texte ls fic* : Donne la liste des fichiers dont le nom a 3
3 9 44 lettres ou plus et commence par fic
37 38
hamurabi% ls -l
total 4
-rw------- 1 gorsen lasso 0 Oct 19 14:03 fic1
drwx------ 2 gorsen lasso 4096 Oct 19 14:07 rep1
40
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
43 44
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
hamurabi% ls -l
z Utilisation des combinaisons de chiffres
Total 2 chmod <ABC> fic
d rwx --- -wx 3 gorsen lasso 4096 Oct 19 13:56 rep1
z A, B et C Chiffres codant les droits
hamurabi% chmod g+x rep1 z A Droits pour l'usager (propritaire)
hamurabi% ls -l z B Droits pour le groupe
Total 2
z C Droits pour les autres
d rwx --x -wx 3 gorsen lasso 4096 Oct 19 13:56 rep1
Principe
hamurabi% chmod uo-w rep1 z Un bit par permission :
hamurabi% ls -l
r = bit 2
Total 2
d r-x --x --x 3 gorsen lasso 4096 Oct 19 13:56 rep1 w = bit 1
x = bit 0
z Valeur : 1 si la permission est prsente, 0 sinon
z Le nombre binaire obtenu est ensuite traduit en dcimal
45 46
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
hamurabi% ls -l
z Utilisation des droits relatifs
Total 2 chmod <qui> = <ref> <+/-> <droits> fichier
d rwx --- -wx 3 gorsen lasso 4096 Oct 19 13:56 rep1
z <ref> reprsente le champ auquel on fait rfrence pour
hamurabi% chmod 710 rep1
tablir les droits sur les autres champs (<qui>)
hamurabi% ls -l
Total 2 z Exemple
d rwx --x --- 3 gorsen lasso 4096 Oct 19 13:56 rep1
hamurabi% ls -l
Total 2
hamurabi% chmod 511 rep1
d rwx --- -wx 3 gorsen lasso 4096 Oct 19 13:56 rep1
hamurabi% ls -l
Total 2
hamurabi% chmod go=u-rw rep1
d r-x --x --x 3 gorsen lasso 4096 Oct 19 13:56 rep1
hamurabi% ls -l
Total 2
d rwx --x --x 3 gorsen lasso 4096 Oct 19 13:56 rep1
47 48
Introduction UNIX N. Gorse Oct. 2003 N. Gorse Oct. 2003
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
z Systmes industriels
z Tlcommunications
51 52
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
z Matriel
Contrleur d'accs au media (carte rseau)
Adresse de la carte rseau
z Logiciel
Protocoles de communication
z Applications
Applications et programmes usagers
53 54
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
55 56
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
57 58
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
59 60
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003
Introduction UNIX N. Gorse Oct. 2003 Introduction UNIX N. Gorse Oct. 2003