Mail Archives: djgpp/2000/07/11/15:15:37
"Rafael García" <rafael AT geninfor DOT com> wrote:
> Does anybody know a portable program to recursively show sizes of
> subdirectories?
> Something like this:
> 945 \dir
> 345 \dir\uno
> 200 \dir\uno\a
> 100 \dir\uno\b
About the most portable existing program that does roughly this would
be GNU 'du', one of the GNU fileutils. It's available on practically
every existing platform, including Windows and DOS (DJGPP).
The one thing it doesn't do is indent the listing by subdirectory,
i.e. you get:
7 ./NeXT/English.lproj/GnuTerm.nib
6 ./NeXT/English.lproj/gnuview.nib
14 ./NeXT/English.lproj
56 ./NeXT
350 ./demo
32 ./docs/latextut
167 ./docs/old
37 ./docs/psdoc
1096 ./docs
11 ./m4
147 ./os2
1267 ./term
222 ./win
3 ./linux/docs/latextut
548 ./linux/docs
3991 ./linux
3 ./alpha/docs/latextut
17 ./alpha/docs
99 ./alpha
10674 .
As often is the case with unix tools, 'du' has tons of options to
influence its output, and you can use the output nicely in other
programs. One nice trick, e.g., is 'du | sort -n' to see which are
the largest subdirectories of any given directory tree.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -