Disk usage on mac in human terms
du -sk * | sort -g | awk '{ numBytes = $1 * 1024; numUnits = split("B K M G T P", unit); num = numBytes; iUnit = 0; while(num >= 1024 && iUnit + 1 < numUnits) { num = num / 1024; iUnit++; } $1 = sprintf( ((num == 0) ? "%6d%s " : "%6.1f%s "), num, unit[iUnit + 1]); print $0; }'
Written by Senthil Kumaran
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Related Tags
#du
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#