Thursday, February 23, 2012

df output format CSV

# File size on your drives in CSV format
# no header on the DF command, append the date to each row
# good for throwin in Excel and doing some trending.

df -Pk | awk '{print $1,$2,$3,$4,$5,$6,strftime("%Y-%m-%d")}' OFS="," | sed -e 1d

0 comments:

Post a Comment