Show Allocated / Used Filesystem Space Summary
On servers with many filesystems calculating filesystem space utilization summary can get very tedious. Below is a simple script that will summarize all filesystems and provide you will the totals for allocated and used space in GB.
Allocated space:
|
1 |
i=0 ; df -kP | grep -v Filesystem | awk '{print $2}' | while read line; do i=$(echo "${i} + ${line}" | bc -l); echo $i; done | tail -1 | while read line2 ; do echo "scale=2;${line2} / 1024 / 1024" | bc -l ; done |
Used space:
|
1 |
i=0 ; df -kP | grep -v Filesystem | awk '{print $3}' | while read line; do i=$(echo "${i} + ${line}" | bc -l); echo $i; done | tail -1 | while read line2 ; do echo "scale=2;${line2} / 1024 / 1024" | bc -l ; done |
-
stingerms
-
Daniel
-
xLittle21Yaox
-
jag43216
-
Xavier Hawthorne
-
Anny
