GNU bug report logs - #7439
du failing at "du -sh . *"

Previous Next

Package: coreutils;

Reported by: Mathias Linnemann-Emden <bier <at> kaffeecontrol.de>

Date: Fri, 19 Nov 2010 01:07:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7439 in the body.
You can then email your comments to 7439 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#7439; Package coreutils. (Fri, 19 Nov 2010 01:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mathias Linnemann-Emden <bier <at> kaffeecontrol.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 19 Nov 2010 01:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathias Linnemann-Emden <bier <at> kaffeecontrol.de>
To: bug-coreutils <at> gnu.org
Subject: du failing at "du -sh . *"
Date: Fri, 19 Nov 2010 02:08:11 +0100
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	.
$ 

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 © 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	.
$ 


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. 


Cheers

Mathias Linnemann-Emden




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Fri, 19 Nov 2010 16:48:02 GMT) Full text and rfc822 format available.

Notification sent to Mathias Linnemann-Emden <bier <at> kaffeecontrol.de>:
bug acknowledged by developer. (Fri, 19 Nov 2010 16:48:02 GMT) Full text and rfc822 format available.

Message #10 received at 7439-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Mathias Linnemann-Emden <bier <at> kaffeecontrol.de>
Cc: 7439-done <at> debbugs.gnu.org
Subject: Re: bug#7439: du failing at "du -sh . *"
Date: Fri, 19 Nov 2010 08:52:39 -0800
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).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Dec 2010 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 190 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.