What's wrong with this Bourne shell script?
Arthur S. Kamlet
ask at cbnews.att.com
Mon Aug 6 05:03:18 AEST 1990
In article <1990Aug3.193231.3166 at silma.com> aab at silma.UUCP (Andy Burgess) writes:
>While you're at it, is there a better way to get the total bytes
>of the files in a directory?
Well, wc .* * will do a fairly good job (remember to surtract out
the . and .. figures. If you want to find the nested files too,
combine with find.
But are you really interested in finding the number of bytes?
Perhaps for your need the number of blocks in the directory,
including nested directories in the same filesystem, can be found
more quickly by reading the superblock with a du -s dir_name
(On my Unix V system, if I don't have read permission, du will
silently not give me those sizes.)
--
Art Kamlet a_s_kamlet at att.com AT&T Bell Laboratories, Columbus
More information about the Comp.unix.questions
mailing list