euglug.org

[Eug-lug] size of files from a shell script, portably

작성자

카테고리:



Jacob MeuserThu Dec 9 01:13:13 PST 2004

On Thu, Dec 09, 2004 at 12:27:55AM -0800, horst wrote:
> >Date: Wed, 8 Dec 2004 22:35:55 -0800
> >From: Jacob Meuser <jakemsr at jakemsr.com>
>  ...
> >>others print the number of bytes.  Which did you want?
> >
> >bytes.  the files need to fit on a DVD.
> >
> 
> I have no idea how universal wc is (though not efficient), but
>  wc -c *.mp3
> does the math for you.

well, I didn't know about wc -c, thanks.  however, the output,
at least on my system, is not easily parsable, as it is oddly
aligned, with varying amounts of space.

-- 
<jakemsr at jakemsr.com>

>  - Horst
> 
> P.S. In a few years python's function os.stat() will be as popular as 
> perl's stat... but of course you'd expected such smelly footnote from my 
> end :-)

:)