1832690 Members
2726 Online
110043 Solutions
New Discussion

directory tree listing

 
SOLVED
Go to solution
Thomas Kopp
Occasional Advisor

directory tree listing

Hi,

how can I list a whole directory tree
( with directories and files, but without inodes, size ... )

Thank's
Thomas Kopp
9 REPLIES 9
Kofi ARTHIABAH
Honored Contributor
Solution

Re: directory tree listing

try

cd /destination_directory
ls -1R

or

cd /destination_directory
find . -print
nothing wrong with me that a few lines of code cannot fix!
Paula J Frazer-Campbell
Honored Contributor

Re: directory tree listing

Hi

ls -R will give you wahat you require

Paula
If you can spell SysAdmin then you is one - anon
Dan Hetzel
Honored Contributor

Re: directory tree listing

Hi Thomas,

ls -R /your_directory
or
find /your_directory -print

will both work the way you want

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Kofi ARTHIABAH
Honored Contributor

Re: directory tree listing

you could also try

cd /destination_directory
du -a | awk '{ print $2 }'
nothing wrong with me that a few lines of code cannot fix!
Rainer_1
Honored Contributor

Re: directory tree listing

try this

find | sort
Devbinder Singh Marway
Valued Contributor

Re: directory tree listing

just to add you can usee t option for time order ie.e ls -lRt
Seek and you shall find
Victor BERRIDGE
Honored Contributor

Re: directory tree listing

Hi,
What about writing a script like:

# dtree : print a hierarchy tree starting at specified directory
# (.default)

(cd ${1-.};pwd);
find ${1-.} -type d -print | sort -f | sed -e "s,^${1-.},," -e "/^$/d" -e "s,[^/]*/\([^/]*\)$,\`-------\1," -e "s,[^/]*/,| ,g"
#
#exit

Just for fun...
Best of all
Victor
Victor BERRIDGE
Honored Contributor

Re: directory tree listing

Wasnt any fun?
I apologize,
I know that no one even for fun should write a script to make a command look like an MS-D0... command output...

Best of all

Victor
Paula J Frazer-Campbell
Honored Contributor

Re: directory tree listing

Victor you are working to hard - take a break before you suggest moving to databases to Windoze servers.

;-)

Paula
If you can spell SysAdmin then you is one - anon