Re: total size of files that match a given mask



On Mon, 10 Jul 2006 16:06:30 -0400,
Chris F.A. Johnson <cfajohnson@xxxxxxxxx> wrote:
On 2006-07-10, Michael C. wrote:
Is there a command that will give you the combined size of the
files that match a given file mask? I've gotten into the habit
of moving the files to a temporary directory and using 'du', but
am hoping there is a more practical way. CLI only please, I'm
already aware that many file managers allow this.

set -- a*.txt
echo "There are $# .txt files in $PWD"

Combined size not number, though that is potentially useful, as it
is significantly faster than:

$ echo "There are `ls -1 a*.txt |wc -l` .txt files in $PWD"


"du -ch a*.txt", does what I need.

Thanks,

Michael C.
--
mcsuper5@xxxxxxxx http://mcsuper5.freeshell.org/

Men do not stumble over mountains but molehills.
.



Relevant Pages

  • total size of files that match a given mask
    ... Is there a command that will give you the combined size of the ... files that match a given file mask? ... I've gotten into the habit ... of moving the files to a temporary directory and using 'du', ...
    (alt.os.linux)
  • Re: total size of files that match a given mask
    ... files that match a given file mask? ... I've gotten into the habit ... of moving the files to a temporary directory and using 'du', ...
    (alt.os.linux)
  • Re: Problem uploading image files
    ... My understanding is that before moving it, the image is on the server ... Wouldn't moving it just result in my pointing to the same image data at ... Is the temp directory being erased before my funciton can read the ... If I could read the image from its temporary directory, ...
    (alt.php)
  • Re: Login Problem How Get to Gui?
    ... > back to the normal Tiger GUI. ... # Then try moving all of Library/Preferences ... # to a temporary directory and see if you can login. ... # Tail the /var/log/system.log file after a login failure. ...
    (comp.sys.mac.system)
  • Re: More Cheezit.
    ... I'm not ashamed to admit that I cured Splash of the habit of fidgeting ... while being mounted and moving away from the mounting block with ...
    (rec.equestrian)