coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] Support for --size in du


From: Pádraig Brady
Subject: Re: [PATCH] Support for --size in du
Date: Mon, 21 Jan 2013 10:30:58 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 01/21/2013 09:51 AM, Bernhard Voelker wrote:
On 01/21/2013 03:11 AM, Pádraig Brady wrote:
>On 01/21/2013 12:46 AM, Bernhard Voelker wrote:
>>I did not alias --threshold to a short -t option ... as I
>>remembered that we should be reluctant to add short options
>>which are not officially standardised.
>
>Yes, but in this case -t is already used in FreeBSD,
>so by adding that, we gain compatibility with it.
>So in this case I'd be inclined to add the -t alias.
Good point, thanks - another amended version attached.

BTW: I noticed that du's options in usage() and in the Texinfo
manual are out of order. I think I'll come up with a cleanup
patch afterwards. WDYT?

good point. -0, -d and --t* are out of order.
Clean up patch welcome.

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 45a4b3d..890d3e1 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -11022,6 +11022,41 @@ With @option{--separate-dirs}, the size reported for a 
directory name,
  @var{d}, is merely the @code{stat.st_size}-derived size of the directory
  entry, @var{d}.

+@item -t @var{size}
+@item --threshold=@var{size}
+@opindex -t
+@opindex --threshold
+Exclude entries based on a given @var{size} (@pxref{Block size}).
+
+If @var{size} is positive, then @command{du} will only print entries with a 
size
+greater than or equal to that.
+
+If @var{size} is negative, then @command{du} will only print entries with a 
size
+smaller than or equal to that.
+
+Although GNU @command{find} can be used to find files of a certain size,
+@command{du}'s @option{--threshold} option can be used to also filter
+directories based on a given size.
+
+Please note that the @option{--threshold} option can be combined with the above

s/above//

+@option{--apparent-size} option, and in this case would elide entries based on
+its apparent size.

diff --git a/tests/du/threshold.sh b/tests/du/threshold.sh
new file mode 100644
index 0000000..9966f4e
--- /dev/null
+++ b/tests/du/threshold.sh
@@ -0,0 +1,360 @@
+#!/bin/sh
+# Exercise du's --theshold option.

s/theshold/threshold/

Apart from those nits please push.

thanks!
Pádraig.



reply via email to

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