Find sum of file sizes listed in ls -l using awk
March 1, 2010 at 9:17 pm · Filed under Technology ·Tagged add, awk, linux, list, sum, unix 1 ls -l | awk ‘{ TOTAL += $5} END { print TOTAL/1024/1024 }’ With this, awk will pull field number 5 from ls -l, which is the size in bytes in most of the *nix platforms. Then… Leer más »