[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wrong size with ls



Thanks !

I understand know why the file lastlog takes only 24 1k-block instead of 6306.
That's because there are a lot of zeros it.


24 -rw-rw-r--    1 root     utmp      6456412 Dec  7 20:59 lastlog


Prakash
_______


bob@proulx.com (Bob Proulx) writes:

Disk blocks used and size of files are related only in that the latter
will always be less than the former on an uncompressed filesystem.

Not quite.  Files on (most) Unix filesystems can contain "holes".  If
there's a large block of zeros in a file, and the file is created in
the right way (like by seeking to a position and then writing) the
blocks containing zeros don't actually take up space on disk.

If you copy or tar files like that, you may need to specify an option
to allow sparse files.

--
Alan Shutko <ats@acm.org> - In a variety of flavors!
Language is a human virus from outer space.






Reply to: