Re: Newbie Needs one Command Davoud writes:
> I need to find a Linux/Unix command that will display a list of all of
> the directories, visible and hidden, on a hard drive, and the sizes of
> those directories.
Assuming that by "hard drive" you actually mean "file system", try:
/bin/ls -lRA /path/to/filesystem | grep '^d' | awk -F ' ' -- '{print $8 FS $5}'
No doubt someone will now demonstrate how to do this more elegantly in
Perl, but grep and awk need a little exercise now and then.
If by "hard drive" you do not mean "file system" you need to tell us what
you do mean. You should also clarify what you mean by the "size" of a
directory. You might also want to tell us what problem you are trying to
solve: there may be an easier way.
--
John Hasler |