
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] Command to find directories containing a particular size of data
- Date: Sun, 3 Apr 2011 08:47:29 +0200
- From: Christian Horn <chorn@example.com>
- Subject: Re: [tlug] Command to find directories containing a particular size of data
- References: <4D97EA2A.7080807@example.com>
- User-agent: Mutt/1.5.20 (2009-06-14)
On Sun, Apr 03, 2011 at 12:31:54PM +0900, Dave M G wrote:
>
> However, what I'd really like is a sort of combination of the two. I
> want to crawl through a whole directory tree, and find the directories
> that contain 10MB or more of files.
>
> When calculating the size of any one directory, I need to know just the
> total size of *files* in that directory, but not including the sizes of
> subdirectories in that total.
# bash, prints directories with >=5mb size
for i in $(find /etc/ -type d); do
if [ $(du -sm $i|awk '{print $1}') -ge 5 ]; then
du -sm $i;
fi;
done
Christian
Home |
Main Index |
Thread Index