Because actual size of a file is part of the detailed statistics of the
actual file, NOT of the disk. Thus 'stat' is the tool that does that job.

You can stat a directory, you do not need to have awk sum things up for you.


On Sat, Apr 5, 2014 at 6:58 PM, Mike Miller <mbmiller+l at gmail.com> wrote:

> On Sat, 5 Apr 2014, David Wagle wrote:
>
>  why it violates the unix philosophy - in my mind - is that apparent size
>> has nothing to do with he primary function of du - which is to display disk
>> usage. And the unix philosophy is to do one thing and do it well.
>>
>> the apparent size flag for du is trying to get du to do things that other
>> utilities already do.
>>
>
>
> Do you mean like find + xargs + awk working in combination...
>
>
> $ find miller -print0 | xargs -0 stat --format=%s | awk
> '{sum+=$1}END{print sum}'
> 145159848954
>
> ...(adding a for loop to deal with a list of directories), or do you mean
> that some utility actually does this?
>
> What was wrong with my argument about the space that would be used on a
> tape if the files were to be written to tape via tar command?
>
> What was wrong with my argument about the size of the files on a
> compressed disk?
>
>
> Mike
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20140406/a560162a/attachment.html>