Re^2: Can ls show total Kbytes of "foo*"?

Rahul Dhesi dhesi at sunscreen.UUCP
Mon Oct 30 11:59:11 AEST 1989


I use shell scripts called "bytes" and "blocks".  They are:

bytes:
   /bin/ls -l $* | awk '{sum = sum + $4} END {print sum}'

blocks:
   du -s $* | awk '{total += $1} END {print total}'

(System V users may need to adjust the field number in the first one.)

The "blocks" script gives me total blocks used by specified files and
directory subtrees.

Rahul Dhesi <dhesi%cirrusl at oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi
Use above addresses--email sent here via Sun.com will probably bounce.



More information about the Comp.unix.questions mailing list