Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!ima!necntc!frog!john From: john@frog.UUCP Newsgroups: comp.unix.questions Subject: Re: Can't ls -l add file sizes properly?? Message-ID: <1943@frog.UUCP> Date: Thu, 19-Nov-87 15:02:00 EST Article-I.D.: frog.1943 Posted: Thu Nov 19 15:02:00 1987 Date-Received: Sat, 21-Nov-87 18:51:01 EST References: <456@morgoth.UUCP> Organization: Superfrog Heaven [ CRDS, Framingham MA ] Lines: 41 In article <456@morgoth.UUCP>, glidden@morgoth.UUCP (Ken A. Glidden) writes: [ In effect, why does ls say "40Kb" when only 35,725 bytes are used. ] > # ls -l > total 40 Ah, but that means 40 BLOCKS, not 40,000 bytes. Here's where it went: > -rwxr--r-- 1 glidden 2117 Aug 6 12:17 acctrpt 3 (1 Kb blocks, note that the last is mostly empty) > -rwxr--r-- 1 glidden 179 Mar 2 1987 age.csh 1 (this whole block is also mostly empty) > -rwxrwxr-- 1 root 1308 Aug 4 16:39 arcjobs.sh 2 > -rwxr-x--- 1 glidden 29696 Mar 2 1987 deltime 29 (exactly) > -rwxr--r-- 1 glidden 269 Sep 9 1986 mailbarry 1 > -r-xr--r-- 1 glidden 296 Aug 25 1986 mailjim 1 > -rwxr--r-- 1 glidden 728 Jan 7 1987 newsindex 1 > -rw-r--r-- 1 root 1132 Aug 4 14:11 tmp 2 > ====== > SUBTOTAL------> 35,725 Real total------------->40 blocks The technical term for this is "breakage," the amount of space wasted by always allocating a fixed size chunk for the (varying length) tail of a file. 4.[23]BSD ameliorates this (somewhat) by using two sizes of blocks, typically 8K and 1K (since they like large blocks, you can see why they'd be concerned about losing half a block, on average, per file!). -- John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101 ...!decvax!frog!john, ...!mit-eddie!jfw, jfw@eddie.mit.edu "Cutting the space budget really restores my faith in humanity. It eliminates dreams, goals, and ideals and lets us get straight to the business of hate, debauchery, and self-annihilation." -- Johnny Hart