Hello,
Est ce qu'il existe une commande permettant d'afficher l'arboresence des fichiers d'un répertoire?
Merci d'avance!![]()
Hello,
Est ce qu'il existe une commande permettant d'afficher l'arboresence des fichiers d'un répertoire?
Merci d'avance!![]()
bonjour,
Est-ce que ceci te conviendrais ?
$ ls -R * > /tmp/arbo.txt 2>/dev/null
Merci d'avance.
GLDavid
Consultez la FAQ Perl ainsi que mes cours de Perl.
N'oubliez pas les balises code :tagcode: ni le tag :resolu:
Je ne répond à aucune question technique par MP.
C'etait deja fait....Envoyé par GLDavid
![]()
![]()
Sinon, j'avais récupéré ce joli script pour avoir un zouli affichage :
Modulo peut-être une ou deux modifs que j'avais faites à l'époque où j'en avais eu besoin, il est dans l'état d'origine
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 #!/bin/bash # tree.sh # Written by Rick Boivie. # Used with permission. # This is a revised and simplified version of a script #+ by Jordi Sanfeliu (and patched by Ian Kjos). # This script replaces the earlier version used in #+ previous releases of the Advanced Bash Scripting Guide. # ==> Comments added by the author of this document. search () { for dir in `echo *` # ==> `echo *` lists all the files in current working directory, #+ ==> without line breaks. # ==> Similar effect to for dir in * # ==> but "dir in `echo *`" will not handle filenames with blanks. do if [ -d "$dir" ] ; then # ==> If it is a directory (-d)... zz=0 # ==> Temp variable, keeping track of directory level. while [ $zz != $1 ] # Keep track of inner nested loop. do echo -n "| " # ==> Display vertical connector symbol, # ==> with 2 spaces & no line feed in order to indent. zz=`expr $zz + 1` # ==> Increment zz. done if [ -L "$dir" ] ; then # ==> If directory is a symbolic link... echo "+---$dir" `ls -l $dir | sed 's/^.*'$dir' //'` # ==> Display horiz. connector and list directory name, but... # ==> delete date/time part of long listing. else echo "+---$dir" # ==> Display horizontal connector symbol... # ==> and print directory name. numdirs=`expr $numdirs + 1` # ==> Increment directory count. if cd "$dir" ; then # ==> If can move to subdirectory... for j in `ls -a` do if [ -f $j ] ; then #echo "$zz $i" bcle=0 while [ $bcle != $zz ] ; do echo -n "| " bcle=`expr $bcle + 1` done echo " $j" fi done search `expr $1 + 1` # with recursion ;-) # ==> Function calls itself. cd .. fi fi fi done } if [ $# != 0 ] ; then cd $1 # move to indicated directory. #else # stay in current directory fi echo "Initial directory = `pwd`" numdirs=0 search 0 echo ""; for j in `ls -a` do if [ -f $j ] ; then #echo "$zz $i" bcle=0 #while [ $bcle != $zz ] ; do # echo -n "| " # bcle=`expr $bcle + 1` #done echo "$j" fi done echo "" echo "Total directories = $numdirs" exit 0![]()
Partager