[PATCH] Support for thresholds in du(1)

jhell jhell at DataIX.net
Fri Feb 5 02:31:15 UTC 2010


On Thu, 4 Feb 2010 06:55, gleb.kurtsou@ wrote:
> On (25/02/2009 17:24), Mel wrote:
>> Hi,
>>
>> 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.
>> --
>> Mel
>
> Hi,
>
> 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 like it!. This certainly reduces some piping but as long as it is not 
integrated upstream it will only become more of a responsibility on 
FreeBSD's behalf to maintain it. If someone has the original authors email 
address I would say lets include him on this and see what he thinks.

This would probably be the same for the pkill thread that I am involved in 
to. CC'ing responsible party for that thread.

Best regards.

This message was supposed to arrive 9 hours ago but there was some ISP 
problems that prevented me from sending it.

-- 

  jhell



More information about the freebsd-hackers mailing list