Re: Total size of specific files



In article <30168764-a5e3-449f-976c-f7770f8afdfa@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Kenneth Brun Nielsen <kenneth.brun.nielsen@xxxxxxxxxxxxxx> wrote:
How can I get the total size of files (in a tree of subdirectories) of
the pattern *.chi?

I tried:

find . -name "*.chi" -printf "%h/%f " | xargs du -total

But it seems to sum up the total in "bursts" - and I'm not sure if I
can trust the final total. Anyway, there must be an easier way?

Various solutions have been posted, but I'll add this general-purpose one:

ftp://ftp.armory.com/pub/scripts/jdu (program)
ftp://ftp.armory.com/pub/scripts/help_pages/jdu (help page)

This is a du-like utility, written using GNU find and gawk. Among its
features, it allows you to give find options to restrict the files counted.
To get the output requested above, you'd use:

jdu -s -f '-name "*.chi"'

John
--
John DuBois spcecdt@xxxxxxxxxx KC6QKZ/AE http://www.armory.com/~spcecdt/
.



Relevant Pages

  • Re: Total size of specific files
    ... the pattern *.chi? ... But it seems to sum up the total in "bursts" - and I'm not sure if I ... I only have two each 40 MB HDDs in my whole computer system. ...
    (comp.unix.shell)
  • Re: Total size of specific files
    ... the pattern *.chi? ... But it seems to sum up the total in "bursts" - and I'm not sure if I ... can trust the final total. ...
    (comp.unix.shell)
  • Re: Total size of specific files
    ... the pattern *.chi? ... But it seems to sum up the total in "bursts" - and I'm not sure if I ... can trust the final total. ...
    (comp.unix.shell)
  • Re: [ANNOUNCE] Anubis language 1.7 release
    ... restricted to a single level, and it has a slightly annoying restriction that patterns must be given in the same orders as the cases of a sum type. ... The conditionals of Anubis are not pattern matching, because pattern matching like in CAML for example, is performed through an ordered set of filters, two of which eventually accepting the datum to be filtered. ... When a datum belongs to such a sum, it belongs to one and exactly one member of the sum. ...
    (comp.lang.functional)
  • Re: Pattern between cubes
    ... its not pattern that i foll0w always, there are ways i can derive ... we can use suitable identiteis to derive such formulae. ... Total sum of squares. ...
    (sci.math)