Re: Total size of specific files
- From: spcecdt@xxxxxxxxxx (John DuBois)
- Date: Thu, 29 May 2008 18:53:12 -0500
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/
.
- Follow-Ups:
- Re: Total size of specific files
- From: 1PW
- Re: Total size of specific files
- From: John DuBois
- Re: Total size of specific files
- References:
- Total size of specific files
- From: Kenneth Brun Nielsen
- Total size of specific files
- Prev by Date: Re: Total size of specific files
- Next by Date: Re: Timeout in Shell script.
- Previous by thread: Re: Total size of specific files
- Next by thread: Re: Total size of specific files
- Index(es):
Relevant Pages
|