[PATCH] Support for thresholds in du(1)
jhell at DataIX.net
Fri Feb 5 03:55:30 UTC 2010
On Thu, 4 Feb 2010 06:55, gleb.kurtsou@ wrote:
> On (25/02/2009 17:24), Mel wrote:
>> attached is a small patch to add threshold support to du(1). I've been using
>> it on 7-STABLE machines for a while, cause I got tired of the noise I get
>> when sorting and then reformatting to human-readable. Especially since
>> sorting isn't part of the equasion "I'd like to see all dirs exceeding a
>> given size".
>> I've not updated the manpage on -STABLE yet, should be the same as HEAD.
>> Example usage:
>> # du -xht 20m .
>> 29M ./contrib/binutils
>> 52M ./contrib/gcc
>> 237M ./contrib
>> 35M ./crypto
>> 28M ./lib
>> 20M ./share
>> 55M ./sys/dev
>> 139M ./sys
>> 545M .
>> I'll file a PR for it, if there's no objections to this feature /
>> implementation, the style(9) or the usage of -t.
> I've cleaned up original patch:
> * fixed style and some bugs
> * as suggested changed it to use expand_number
> * implemented support for negative threshold values
> I find the patch very useful. Does it look ok to be commited, or should
> I file a PR so it won't get lost once again.
> Example usage:
> src/sys/crypto % du -ht 100k
> 137K ./des
> 482K .
> src/sys/crypto % du -A -ht +100k
> 129K ./des
> 446K .
> src/sys/crypto % du -ht -100k
> 56K ./camellia
> 11K ./salsa20
> 38K ./sha2
> 9.0K ./rc4
> 68K ./des/arch/i386
> 70K ./des/arch
> 88K ./rijndael
> 37K ./via
> 8.0K ./hmac
> 36K ./blowfish/arch/i386
> 37K ./blowfish/arch
> 85K ./blowfish
I would recommend generating this patch as a unified diff or a svn or cvs
diff whichever version you checked out your tree with.
More information about the freebsd-hackers