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

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



On Thu, Aug 14, 2008 at 2:36 PM, Nifty Cluster Mitch
<niftycluster@xxxxxxxxxxxx> wrote:
>
> $ cat /tmp/checkspace
> #!/bin/bash
> df -Pkl > /tmp/checkingdiskspce
> echo -e "\nInput is:"
> cat /tmp/checkingdiskspce
> echo -e "\nAdding up the bits"
> cat /tmp/checkingdiskspce | awk '/^\/dev\// { used += $3/1024 } END { printf("%d Mb Used\n", used)} '

This is simpler (and does not involve as many execs & forks) as:

awk '/^\/dev\// { used += $3/1024 } END { printf("%d Mb Used\n",
used)} ' /tmp/checkingdiskspce

mhr
_______________________________________________
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