[CentOS] df to get total disk usage on all filesystems?

Stephen Harris lists at spuddy.org
Mon Aug 11 19:06:49 UTC 2008


> Is there a flag for the df command to get the total disk space used on
> all filesystems as one number?  I have a server with a lot of mounted
> shares.  I'm looking for a simple way to measure rate of data growth
> across all shares as one total value.

Not directly, but you can add up all the entries mounted from /dev with
a simple awk statement:

df -kl | awk '/^\/dev\// { avail += $3/1024 } END { printf("%d Mb used\n",avail)} '

-- 

rgds
Stephen



More information about the CentOS mailing list