On Monday, Oct 22nd 2007 at 10:17 -0000, quoth Ben Scott:

=>On 10/22/07, Shawn K. O'Shea <[EMAIL PROTECTED]> wrote:
=>> Since I know Kent has a Mac and this might be on his laptop, I'd like
=>> to add that this should really be:
=>> du -ck *.txt | tail -1
=>
=>  Since we're on the subject, it should also be noted that "du" means
=>*disk usage*.  That means du is supposed to be aware of things like
=>allocation overhead (a 3 byte might use 4096 bytes on disk, or
=>whatever) and sparse files (files with "holes" in the middle, thus
=>using *less* space on disk than the file size).
=>
=>  The GNU variant, at least, has an option to report actual file sizes
=>instead of disk usage.
=>
=>  Which one you want depends on what you're looking for.

I'd just like to kibbutz one more subtlety: du reports disk usage as 
discussed above, but another way that you can get seemingly conflicting 
numbers is from sparse files, i.e., where the length of the file is large, 
but still contains little data.

f = open ( "newfile", O_CREAT | O_WRONLY );
lseek ( f, 1000000000, SEEK_SET );
close ( f );

Bang. You now have a file that ls will report as 1 gig and yet still 
occupies almost no space on the dick.

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
_______________________________________________
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/

Reply via email to