TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:1777] directory sizes
>>>>> "Ben" == Ben Luey <lueyb@carleton.edu> writes:
>> you can use -s to create summery's.
Ben> If I type 'du -s *' I get what I want except it includes all
Ben> the files in the directory I'm in when I run du. Is there a
Ben> way (I didn't see this in the man page) to tell it to ignore
Ben> files in the current directory and just count file under the
Ben> directories?
Ben> Thanks,
Ben> Ben
This is the problem I mentioned with du. It can do some things well
but others are very complicated. The trick is to pass du the correct
file list. To whit we only want to pass it a list of directories
looking in "Unix power tools" we find the answer: ls -d */.
So now you can say
du -s `ls -d */.`
Andrew