[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: --min-size option for du (patch)

From: Paul Chambers
Subject: Re: --min-size option for du (patch)
Date: Wed, 14 Jan 2009 20:53:55 -0800
User-agent: Thunderbird (Windows/20081209)

Perhaps I'm missing something, but won't that only find large individual files? What if a directory (or subtree) has a very large number of small to medium-sized files? (e.g. someone's music or photo collection). The docs I've found for find's -size option refer to file size, no discussion of behavior with directories.

My goal here is to quickly find what's consuming the disk space, and in my experience, it's not usually huge individual files.

-- Paul

Eric Blake wrote:
Hash: SHA1

According to Paul Chambers on 1/14/2009 3:54 PM:
I'd like to submit the attached small patch for du. it adds a
'--min-size' option, which can be used to filter the output to only
include items of that size or greater.

It seems like find(1) might be a better tool for this.  It has the
advantage of already being standardized, so you wouldn't be relying on a
non-portable extension.  For example, this is the POSIX-mandated way to
find all files that are at least a mebibyte in size:

find . -size $(( 1024 * 1024 ))c

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]