Summarizing Disk Information

I wrote some extended objects for gathering disk information using the 'df' command.  Here are two examples for gathering total disk space and total available disk space.  Both use generic grammar.

 

Total Disk Space

"df | awk '{print $2}' | grep '[0-9]' | awk '{sum = sum + $1} END {print sum}'"

 

Total Available Disk Space

"df | awk '{print $4}' | grep '[0-9]' | awk '{sum = sum + $1} END {print sum}'"