From unknown Sun Jun 22 17:12:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7439: du failing at "du -sh . *" Resent-From: Mathias Linnemann-Emden Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 19 Nov 2010 01:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7439 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 7439@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1290128810671 (code B ref -1); Fri, 19 Nov 2010 01:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Nov 2010 01:06:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJFRC-0000Am-3r for submit@debbugs.gnu.org; Thu, 18 Nov 2010 20:06:50 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJFNh-00008w-14 for submit@debbugs.gnu.org; Thu, 18 Nov 2010 20:03:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJFSb-0003H6-Os for submit@debbugs.gnu.org; Thu, 18 Nov 2010 20:08:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:35977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJFSb-0003H1-Mp for submit@debbugs.gnu.org; Thu, 18 Nov 2010 20:08:17 -0500 Received: from [140.186.70.92] (port=42665 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJFSa-0002mv-QW for bug-coreutils@gnu.org; Thu, 18 Nov 2010 20:08:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJFSZ-0003Gq-G7 for bug-coreutils@gnu.org; Thu, 18 Nov 2010 20:08:16 -0500 Received: from helixnetworks.de ([94.23.26.215]:36860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJFSZ-0003Gi-Bi for bug-coreutils@gnu.org; Thu, 18 Nov 2010 20:08:15 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by helixnetworks.de (Postfix) with ESMTP id 26266489DD for ; Fri, 19 Nov 2010 02:08:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ns367589.ovh.net Received: from helixnetworks.de ([127.0.0.1]) by localhost (ns367589.ovh.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y+CagRqePvu0 for ; Fri, 19 Nov 2010 02:08:12 +0100 (CET) Received: from scratchy.linnemann.lan (p54A5A347.dip.t-dialin.net [84.165.163.71]) by helixnetworks.de (Postfix) with ESMTPSA id 852D848561 for ; Fri, 19 Nov 2010 02:08:12 +0100 (CET) Date: Fri, 19 Nov 2010 02:08:11 +0100 From: Mathias Linnemann-Emden Message-ID: <20101119020811.2d6dbe49@scratchy.linnemann.lan> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -6.6 (------) X-Mailman-Approved-At: Thu, 18 Nov 2010 20:06:48 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) Hey there, I don't know for sure if this is a bug in 'du' or not - but I've requested several people to test it and we all get the same results: $ mkdir du_test $ cd du_test/ $ touch a b c d $ echo "11111111" >e $ du -sh . * 8,0K . $ du -sh * . 0 a 0 b 0 c 0 d 4,0K e 4,0K . $=20 So not only the output of "du -sh . *" is wrong (not showing du for *), but also the output of "du -sh * ." is incorrect (showing only 4K instead of 8K for "."). I use bash as my shell, but this also happens with sh, zsh, and several other shells i've tried so far. the version of coreutils I run is: $ du --version du (GNU coreutils) 8.7 Copyright =A9 2010 Free Software Foundation, Inc. We've found out that the behaviour of du from coreutils 8.6 and below is as expected: $ mkdir du_test $ cd du_test/ $ touch a b c d $ echo "11111111" >e $ du -sh . * 8,0K . 0 a 0 b 0 c 0 d 4,0K e $ du -sh * . 0 a 0 b 0 c 0 d 4,0K e 8,0K . $=20 I'm using ArchLinux with kernel 2.6.35-ARCH #1 SMP (x86_64). Filesystem is ext4. The bug also is present on ext3, btrfs and ext2 filesystems (I don't know if this might be of any relevance). Please feel free to respond if you should have any further questions.=20 Cheers Mathias Linnemann-Emden From unknown Sun Jun 22 17:12:58 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mathias Linnemann-Emden Subject: bug#7439: closed (Re: bug#7439: du failing at "du -sh . *") Message-ID: References: <4CE6AB57.8040003@cs.ucla.edu> <20101119020811.2d6dbe49@scratchy.linnemann.lan> X-Gnu-PR-Message: they-closed 7439 X-Gnu-PR-Package: coreutils Reply-To: 7439@debbugs.gnu.org Date: Fri, 19 Nov 2010 16:48:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1290185282-3276-1" This is a multi-part message in MIME format... ------------=_1290185282-3276-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #7439: du failing at "du -sh . *" which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 7439@debbugs.gnu.org. --=20 7439: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7439 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1290185282-3276-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 7439-done) by debbugs.gnu.org; 19 Nov 2010 16:47:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJU7c-0000qS-1A for submit@debbugs.gnu.org; Fri, 19 Nov 2010 11:47:36 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJU7Z-0000qI-Eo for 7439-done@debbugs.gnu.org; Fri, 19 Nov 2010 11:47:34 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 595FD39E814F; Fri, 19 Nov 2010 08:52:40 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N84+pbrA7lMd; Fri, 19 Nov 2010 08:52:39 -0800 (PST) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id DB5B439E814E; Fri, 19 Nov 2010 08:52:39 -0800 (PST) Message-ID: <4CE6AB57.8040003@cs.ucla.edu> Date: Fri, 19 Nov 2010 08:52:39 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Mathias Linnemann-Emden Subject: Re: bug#7439: du failing at "du -sh . *" References: <20101119020811.2d6dbe49@scratchy.linnemann.lan> In-Reply-To: <20101119020811.2d6dbe49@scratchy.linnemann.lan> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 7439-done Cc: 7439-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) On 11/18/2010 05:08 PM, Mathias Linnemann-Emden wrote: > So not only the output of "du -sh . *" is wrong (not showing du for *), > but also the output of "du -sh * ." is incorrect (showing only 4K > instead of 8K for "."). NEWS lists this as a bug fix in release 8.6: du no longer multiply counts a file that is a directory or whose link count is 1, even if the file is reached multiple times by following symlinks or via multiple arguments. The idea is that a single invocation of du never counts the same file twice. This was always true for files with multiple hard links (you probably didn't notice that), and now it's consistent for all files. To get something like the old behavior, you can use "du -l", or invoke "du" separately for each file (depending on how you want hard links treated). ------------=_1290185282-3276-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 Nov 2010 01:06:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJFRC-0000Am-3r for submit@debbugs.gnu.org; Thu, 18 Nov 2010 20:06:50 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJFNh-00008w-14 for submit@debbugs.gnu.org; Thu, 18 Nov 2010 20:03:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJFSb-0003H6-Os for submit@debbugs.gnu.org; Thu, 18 Nov 2010 20:08:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:35977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJFSb-0003H1-Mp for submit@debbugs.gnu.org; Thu, 18 Nov 2010 20:08:17 -0500 Received: from [140.186.70.92] (port=42665 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJFSa-0002mv-QW for bug-coreutils@gnu.org; Thu, 18 Nov 2010 20:08:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJFSZ-0003Gq-G7 for bug-coreutils@gnu.org; Thu, 18 Nov 2010 20:08:16 -0500 Received: from helixnetworks.de ([94.23.26.215]:36860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJFSZ-0003Gi-Bi for bug-coreutils@gnu.org; Thu, 18 Nov 2010 20:08:15 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by helixnetworks.de (Postfix) with ESMTP id 26266489DD for ; Fri, 19 Nov 2010 02:08:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ns367589.ovh.net Received: from helixnetworks.de ([127.0.0.1]) by localhost (ns367589.ovh.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y+CagRqePvu0 for ; Fri, 19 Nov 2010 02:08:12 +0100 (CET) Received: from scratchy.linnemann.lan (p54A5A347.dip.t-dialin.net [84.165.163.71]) by helixnetworks.de (Postfix) with ESMTPSA id 852D848561 for ; Fri, 19 Nov 2010 02:08:12 +0100 (CET) Date: Fri, 19 Nov 2010 02:08:11 +0100 From: Mathias Linnemann-Emden To: bug-coreutils@gnu.org Subject: du failing at "du -sh . *" Message-ID: <20101119020811.2d6dbe49@scratchy.linnemann.lan> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 18 Nov 2010 20:06:48 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) Hey there, I don't know for sure if this is a bug in 'du' or not - but I've requested several people to test it and we all get the same results: $ mkdir du_test $ cd du_test/ $ touch a b c d $ echo "11111111" >e $ du -sh . * 8,0K . $ du -sh * . 0 a 0 b 0 c 0 d 4,0K e 4,0K . $=20 So not only the output of "du -sh . *" is wrong (not showing du for *), but also the output of "du -sh * ." is incorrect (showing only 4K instead of 8K for "."). I use bash as my shell, but this also happens with sh, zsh, and several other shells i've tried so far. the version of coreutils I run is: $ du --version du (GNU coreutils) 8.7 Copyright =A9 2010 Free Software Foundation, Inc. We've found out that the behaviour of du from coreutils 8.6 and below is as expected: $ mkdir du_test $ cd du_test/ $ touch a b c d $ echo "11111111" >e $ du -sh . * 8,0K . 0 a 0 b 0 c 0 d 4,0K e $ du -sh * . 0 a 0 b 0 c 0 d 4,0K e 8,0K . $=20 I'm using ArchLinux with kernel 2.6.35-ARCH #1 SMP (x86_64). Filesystem is ext4. The bug also is present on ext3, btrfs and ext2 filesystems (I don't know if this might be of any relevance). Please feel free to respond if you should have any further questions.=20 Cheers Mathias Linnemann-Emden ------------=_1290185282-3276-1--