On Tue, 12 Oct 2004 11:29:47 -0600, Grant Robinson <[EMAIL PROTECTED]> wrote: > > On Oct 12, 2004, at 8:26 AM, Andrew Jorgensen wrote: > > > I'd like to find the total file size of a directory (with > > sub-directories). I can use 'du -s' except that I've been told that > > 'du' reports disk usage, which is not the same as file size. 'ls -l' > > will tell me the actual size of a single file, but won't tell me the > > sum of the sizes of files in a directory. > > My question is why you would want summed file sizes (the actual sizes > of the file) vs. how much disk space the files are actually using? It > seems that what most people are really interested in is how much space > a directory (and the files and sub-directories inside) are using up on > the disk. Are you trying to calculate file system overhead or > something? You already received some answers on how to use file size, > if this is really what you want to do, so I won't repeat them.
In my case it's because I'm comparing two machines. I'm going to check to size of /usr/local on both and compare them to see if someone has been compiling from source (and hence not registering stuff with rpm). I know that the disk usage is likely to be the same, but isn't guaranteed to be while the real (or apparent I guess) file sizes will be the same if the files are the same. Before someone suggests MD5 let me say that it's not that important, but it is important enough to check sizes. We're not looking for hackers, just misguided developers. ____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
