ls -l $* | awk ' # filesum: list files and total size in bytes # input: long listing produced by "ls -l" #1 output column headers BEGIN { printf("%-15s\t%10s\n","FILE","BYTES" ) } #2 test for 9 fields; files begin with "-" NF == 9 && /^-/ { sum += $5 # accumulate size of file ++filenum # count number of files printf("%-15s\t%10d\n", $9, $5) # print filename and size } #3 test for 9 fields; directory begins with "d" NF == 9 && /^d/ { print "