coreutils
[Top][All Lists]
Advanced

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

Re: du -s excluding size from directory entries?


From: Pádraig Brady
Subject: Re: du -s excluding size from directory entries?
Date: Sat, 25 Jan 2014 04:33:11 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 01/25/2014 04:25 AM, Aaron Davies wrote:
>> On Jan 24, 2014, at 3:40 PM, Pádraig Brady <address@hidden> wrote:
>>
>>> On 01/24/2014 08:41 PM, Aaron Davies wrote:
>>> would people be interested in a patch implementing this? it's about a
>>> dozen lines to add (~60 line patch).
>>>
>>>> On Sat, Apr 13, 2013 at 2:15 AM, Pádraig Brady <address@hidden> wrote:
>>>>> On 04/13/2013 08:22 AM, Aaron Davies wrote:
>>>>> is there an easy way to `du -s' a tree and ignore the size of the 
>>>>> directories themselves?
>>>>>
>>>>> if, e.g., i have one deep directory tree with a long history of 
>>>>> modifications, and another directory tree created from a `cp -a' of the 
>>>>> first, their `du -sb' results are likely to be somewhat different.
>>>>>
>>>>> i can get this result with something like `find -not -type d 
>>>>> -print0|xargs -r0 stat -c %s|paste -sd+|bc', but a simpler solution would 
>>>>> be nice.
>>>>
>>>> How about:
>>>>
>>>>  find -not -type d -print0 | du -hc --files0-from=- | tail -n1
>>>>
>>>> That deals with hard links in the set too.
>>
>> Does the above not suffice?
>> If it does it's probably better than adding extra options?
> 
> Well, it's not terrible, and it does what I asked for, but it's not exactly 
> easy to type (or remember). With my patch, that turns into `du -sbp` .
> 
> (Insert joke about GNU program options here.)
> 

In that case I'd be leaning towards this functionality
being esoteric enough that the proposed existing solution suffices.

thanks,
Pádraig.



reply via email to

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