Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!marque!nic From: nic@marque.mu.edu (Nic Bernstein) Newsgroups: comp.unix.questions Subject: Re: Can't ls -l add file sizes properly?? Message-ID: <1925@marque.mu.edu> Date: Thu, 19-Nov-87 08:42:01 EST Article-I.D.: marque.1925 Posted: Thu Nov 19 08:42:01 1987 Date-Received: Sat, 21-Nov-87 19:33:05 EST References: <456@morgoth.UUCP> Reply-To: nic@marque.UUCP (Nic Bernstein) Organization: Marquette University - Milwaukee, Wisconsin Lines: 48 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 >-rwxr-x--- 1 glidden 29696 Mar 2 1987 deltime >-rwxr--r-- 1 glidden 269 Sep 9 1986 mailbarry >-r-xr--r-- 1 glidden 296 Aug 25 1986 mailjim >-rwxr--r-- 1 glidden 728 Jan 7 1987 newsindex >-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) >**** > >-- >LIVE: Ken A. Glidden, (617) 969-0050 >ARPA: adelie!morgoth!glidden@harvard.HARVARD.EDU >UUCP: {harvard | ll-xn | mirror | axiom}!adelie!morgoth!glidden First of all, there might be some hidden files involved ( how about something like .cshrc, .profile, etc. ). This isn't the case here however, you should have run "ls -ls" which would also report the block sizes of the files (should look like this): 2 -rwxr--r-- 1 glidden 2117 Aug 6 12:17 acctrpt 1 -rwxr--r-- 1 glidden 179 Mar 2 1987 age.csh 2 -rwxrwxr-- 1 root 1308 Aug 4 16:39 arcjobs.sh 29 -rwxr-x--- 1 glidden 29696 Mar 2 1987 deltime 1 -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 2 -rw-r--r-- 1 root 1132 Aug 4 14:11 tmp This first number is the number of blocks allocated to the file and will always be at a 1024 byte boundry (at least on your machine). This means that the file "age.csh" which is only 179 bytes, takes up 1024 bytes of disk space. The number reported by "ls" and also by "du" is useful to determine the amount of space you would have to allocate to back up the files with cpio, tar etc. You also then would have to add hidden files ("ls -als") and usually add a block for the directory itself ("."), unless it is very large, then it would be more, but "ls -als" will report the size of ".". - Nic