[Top][All Lists]

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

bug#10863: A possible du bug?

From: Eric Blake
Subject: bug#10863: A possible du bug?
Date: Tue, 21 Feb 2012 10:23:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120209 Thunderbird/10.0.1

tag 10863 notabug

On 02/21/2012 05:22 AM, George R Goffe wrote:
> Hi,
> I'm running the du command from / and am seeing other file systems even 
> though -x is specified. 
> Here's the full command + args: du -xs -- .??* * | sort -k1nr | more

> Am I doing something wrong or misunderstanding something?

There's your problem.  -x applies to each command line argument, but you
are passing multiple command line arguments.  Therefore, you are
computing the disk usage of /usr and all subdirectories within the same
device as /usr, of /opt and all subdirectories within the same device as
/opt, and so forth.

If you really wanted to compute the usage of just / and all
subdirectories on the same device as /, then use du -x /, not du -x /*.

I'm closing this out as not a bug, as the du was doing what it was asked
after the shell glob expansion is taken into account.

Side note - your glob does not list all files.  It's possible to name a
file '.a', which matches neither '.??*' nor '*'.  To properly catch
_all_ files, you need three globs, as in '.??* * .[!.]'.

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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