Pádraig Brady <[email protected]> writes:

> On 28/11/2025 18:50, Collin Funk wrote:
>> Hi,
>> You wrote:
>> 
>>> In a directory with this:
>>>
>>> $du --total *
>>> 10240   10-Megs
>>> 20480   20-Megs
>>> 61444   60-Megs
>>> 81924   80-Megs
>>> 174088  total
>>>
>>> I would expect du --total --threshold -50M * to be
>>>
>>> $du --total --threshold -50M *
>>> 10240   10-Megs
>>> 20480   20-Megs
>>> 30720   total
>
>> I agree it is a bit unclear, but FreeBSD operates the same way.
>> Therefore, I am inclined to keep the existing behavior.
>
> Right. Though it's probably worth mentioning in the info docs
> that --threshold is a display threshold, and thus does
> not impact --total.

How does this patch look?

Collin

>From d2735e9b3e85658f8d460a0967f127d5c2ea3630 Mon Sep 17 00:00:00 2001
Message-ID: <d2735e9b3e85658f8d460a0967f127d5c2ea3630.1764462528.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Sat, 29 Nov 2025 16:17:40 -0800
Subject: [PATCH] doc: du: mention the behavior when both --threshold and
 --total are used

* doc/coreutils.texi (du invocation): Mention that --threshold has no
effect on the grand total calculated when --total is used.
Addresses https://bugs.gnu.org/71309
---
 doc/coreutils.texi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 583686212..71fb01649 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12921,6 +12921,9 @@ @node du invocation
 When combined with the @option{--inodes} option, it elides entries
 based on inode counts.
 
+When combined with the @option{--total} option, the @option{--threshold}
+option does not prevent entries from being added to the grand total.
+
 Here's how you would use @option{--threshold} to find directories with a size
 greater than or equal to 200 megabytes:
 
-- 
2.52.0

Reply via email to