Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!oberon!bbn!uwmcsd1!ig!jade!ucbvax!sdcsvax!ucsdhub!hp-sdd!ncr-sd!ncrcae!usceast!still From: still@usceast.UUCP (Bert Still) Newsgroups: comp.unix.questions Subject: Re: Can't ls -l add file sizes properly?? Message-ID: <2463@usceast.UUCP> Date: Sat, 21-Nov-87 14:14:27 EST Article-I.D.: usceast.2463 Posted: Sat Nov 21 14:14:27 1987 Date-Received: Wed, 25-Nov-87 23:30:07 EST References: <456@morgoth.UUCP> Reply-To: still@usceast.UUCP (Bert Still) Organization: University of South Carolina, Columbia Lines: 38 Summary: Sure... but it's not the file sizes that counts... In article <456@morgoth.UUCP> glidden@morgoth.UUCP (Ken A. Glidden) writes: ># ls -l >total 40 >-rwxr--r-- 1 glidden 2117 Aug 6 12:17 acctrpt >-rwxr--r-- 1 glidden 179 Mar 2 1987 age.csh >-rwxrwxr-- 1 root 1308 Aug 4 16:39 arcjobs.sh [... other files left out ...] >-rw-r--r-- 1 root 1132 Aug 4 14:11 tmp > ====== >SUBTOTAL------> 35,725 > >**** >Why does the ls -l "total" give me 40Kb and my manual addition of the file >sizes give me 35.7Kb !?!?!?! (Note: This came from Ultrix 2.0 on a DEC uVAX II) >**** > What you need to notice here, is that the "total 40" line indicates how many disk BLOCKS are in use inside this directory. If a file occupies any part of a disk block, the whole block will be allocated to that file. Thus, the file age.csh occupies 1 block, while arcjobs.sh occupies 2. If you divide the character-count of each file by 1024, then round each answer up and sum, you will get the 40 listed. The "wasted space" is usually called overhead, and that is why 1k blocks were chosen over 2k or 4k blocks. Bert -------------------------------------------------------------------------------- It's great to be the systems manager.... pull. -------------------------------------------------------------------------------- UUCP: ...seismo!ncr-sd!ncrcae # US SNAIL: Bert Still !usceast!still # Dept of Mathematics CSNET: still@cs.scarolina.edu # University of South Carolina # Columbia, SC 29208 BITNET: T410119@UNIVSCVM # --------------------------------------------------------------------------------