Re: df to get total disk usage on all filesystems?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Stephen Harris wrote:
And, remember, that the output of "df" might have changed in between
times you ran "df" and you ran the "awk" command; there's only 7Mbytes
difference.  Did someone delete a 7Mbyte file?  Send email?  Finish a
print job?  Or... could be plenty of reasons for the used amount to
go down.

The awk script works correctly, as can be tested easily:

  $ cat h
  Filesystem         1024-blocks      Used Available Capacity Mounted on
  /dev/mapper/VolGroup00-LogVol00 274405432  18584656 241656808       8% /
  /dev/sda2               101105     19096     76788      20% /boot
  tmpfs                  1682508         0   1682508       0% /dev/shm

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

But the whole system used only 18 MB ? That's not true.


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux