Vous êtes sur la page 1sur 3

Compte rendu

TP2 : Unix &shell

NOM : SOUKAINA MOUHCINE N :66


Enoncé 1 : Find
1) cd
pwd
find

2) find /bin /lib


3) find chapitre5 -type d
find chapitre5 -type f
4) cd chapitre5
find -name ‘fik*’
5) find –size +10M -perm 755

Enoncé 2 : Caractères génériques


1) cd /etc
2) ls | grep "^r"
3) ls –d ???
4) ls –d rc[234].d
5) ls | grep "^[^a-c]"
6) ls | grep "^[A-Z]"
7) ls *{conf,config}
8) ls [a-z]*a?{.conf,.config}

Enoncé 3 : Redirection et tubes

1) cat
tp
tp
ensa
ensa

 La touche (ctrl-D) permet de terminer la commande normalement.


 On constate que la commande  cat retourne les lignes qu’on a entré .

2) wc
ensa
tp
 La touche (ctrl-D) permet de terminer la commande normalement.
 La commande « wc » sans passer aucun paramètre affiche ce résultat :
  
2 2 10

 Les trois nombres indiqués sont 2 (nombre de lignes), 2 (nombre de mots)


et 10 (nombre d’octets) .

3) cat /etc/hosts
cat < /etc/hosts

4) cat > /tmp/ficcat


tp
ensakh
et on tape pour verifier :
cat /tmp/ficcat

5) cat < /tmp/ficcat > /tmp/ficcat2

6) cat >> /tmp/ficcat


Tp
Ajouter
Ensakh
cat /tmp/ficcat

7) cat /tmp/ficcat /etc/hosts > /tmp/ficcat3


cat /tmp/ficcat3

8) cd /etc
ls > /tmp/ls.out
cat /tmp/ls.out

9) wc –l < /tmp/ls.out

10) ls /etc/ | wc –l

11) ls /etc | wc -l >/tmp

Vous aimerez peut-être aussi