Arborescence de fichier

Fermé
Mika - 11 janv. 2005 à 17:41
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 - 11 janv. 2005 à 20:35
Bonjour à tous, j'aurais vraiment besoin d'aide pour un petit programme sur red hat.
Je suis débutant sous linux et j'ai vraiment du mal. J'essaie de faire des petits programmes. Si vous pouviez m'aider concernant un petit^programme qui permettrait à partir d'un nom de répertoire de créer son arboescence . Ce programme me permettrait aussi de faire la recherche d'un fichier ou d'un répertoire quelconque.
Ce serait sympa de me communiquer vos suggestions
Merci d'avance et à toute.
A voir également:

1 réponse

jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 894
11 janv. 2005 à 20:35
Salut,

En ce qui concerne l'arborescence, tu as déjà une commande qui fait ça. C'est la commande "tree". En lui passant en paramètre le répertoire de ton choix elle t'affichera toute l'arborescence de ce répertoire et de ses sous-répertoires :
[jp@Mandrake jp]$ tree tmp/
tmp/
|-- 61v2344.pdf
|-- 8486.pts-3.Mandrake
|-- 8800.pts-4.Mandrake
|-- 9035.pts-4.Mandrake
|-- burn.sh
|-- gravage~
|-- larrytools.zip
|-- lolo
|   `-- toolkit.zip
|-- orbit-jp
|   |-- bonobo-activation-register.lock
|   |-- bonobo-activation-server-ior
|   |-- linc-1060-0-91adfabe0a06
|   |-- linc-108f-0-37882b788635
|   |-- linc-10ef-0-1c65bc19b9d37
|   |-- linc-11b1-0-42b3b82436cbd
|   |-- linc-1386-0-5729cc5b59847
|   |-- linc-1aa9-0-7e99da79ed791
|   |-- linc-1af9-0-6a304591a272f
|   |-- linc-1b86-0-3cd5a738b972e
|   |-- linc-1c7c-0-5c394292d4791
|   |-- linc-1e5c-0-7b64ee8440c3
|   |-- linc-1f22-0-5a6bc0c672f
|   |-- linc-1f48-0-2c5683aa7b17d
|   |-- linc-2096-0-3835f70d2be1e
|   |-- linc-21d9-0-36b0129044f5f
|   |-- linc-24d0-0-ba34d84665b8
|   |-- linc-2610-0-1dc414c88649a
|   |-- linc-2cac-0-2cfbb37aedc9c
|   |-- linc-2ced-0-5df17dc17a4ac
|   |-- linc-2da7-0-23e02db35f555
|   |-- linc-b39-0-37c2036291366
|   |-- linc-b3d-0-4237448558871
|   |-- linc-b65-0-76f65e2bf503
|   |-- linc-c2c-0-1c04a8e04bbc0
|   `-- linc-e59-0-2a0da74fa23fd
|-- pingo
|-- pingo~
|-- table_partitions
|   |-- sauvegarde_etendue_hda.sf
|   |-- sauvegarde_etendue_hdc.sf
|   |-- sauvegarde_mbr_hda
|   |-- sauvegarde_mbr_hdc
|   `-- table_partition_mandrake.txt
|-- test
`-- try
    |-- essai.sh
    |-- fich.txt
    |-- fich1.avi
    |-- fich1.doc
    |-- fich1.txt
    |-- fich10.avi
    |-- fich10.doc
    |-- fich10.txt
    |-- fich2.avi
    |-- fich2.doc
    |-- fich2.txt
    |-- fich3.avi
    |-- fich3.doc
    |-- fich3.txt
    |-- fich4.avi
    |-- fich4.doc
    |-- fich4.txt
    |-- fich5.avi
    |-- fich5.doc
    |-- fich5.txt
    |-- fich6.avi
    |-- fich6.doc
    |-- fich6.txt
    |-- fich7.avi
    |-- fich7.doc
    |-- fich7.txt
    |-- fich8.avi
    |-- fich8.doc
    |-- fich8.txt
    |-- fich9.avi
    |-- fich9.doc
    |-- fich9.txt
    |-- script_01.sh
    |-- tri.sh
    |-- tri.sh~
    `-- try2.sh

4 directories, 78 files
[jp@Mandrake jp]$
Quant à la recherche d'un fichier et d'un répertoire, intéresses-toi aux commandes "find" et "grep".

;-))

Z'@+...che.
JP : Zen, my Nuggets ! ;-)
sh:/bin/laden: Not found !
0