l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2004 Sep 21 22:59

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] solved puzzle: free du and df disagree about free diskspace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] solved puzzle: free du and df disagree about free diskspace

On Tue, Sep 21, 2004 at 06:29:31PM -0700, Karsten M. Self wrote:
> on Tue, Sep 21, 2004 at 08:25:20AM -0700, Henry House (hajhouse@houseag.com) wrote:
> > 
> > As you can see from these transcripts, 'du' told me that I had used
> > less than 1 GB on this machine's /var, but according to 'df' there
> > was still no free space.
> Moral Jr:  'du' and 'df' report different statistics.
> 'df' reports the free space on disk.  'du' reports the utilization (in
> blocks) of detectectable files (by definition:  files which aren't,
> say, deleted but with handles held open by running processes).  Adding
> a third mix:  'ls' reports not the size-on-disk (used blocks) but
> actual data size within the file.

Here's a quick and dirty Perl script I wrote a while back to report the
accurate size of files and directories.  It uses stat() recursively.
I'm attaching it in case someone might find it useful.  Just call it
with your file/dir arguments (or none for the current directory).  It
seems to work pretty well (I'll rely on the Perl hackers in the group to


Attachment: fsize.pl
Description: Perl program

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.