[ To find disk size ]
AIX | df | awk '/^\/dev/ { sum+=$2; } END { printf("%.0f\n", sum/1024/1024) }' |
HP-UX | bdf | awk '/^\/dev/ { sum+=$2; } END { printf("%.0f\n", sum/1024/1024) }' |
SunOS | df
-k | awk 'NF==1 {printf("%s ",$0)}; NF==5 {print $0}; NF>=6
{print $0}' | sed -n '2,$ p' | \ grep -v swap | awk '{ sum+=$2; } END { printf("%.0f\n", sum/1024/1024) }' |
Linux | df -P | grep -v sr0 | awk '/^\/dev/ { sum+=$2; } END { printf("%.0f\n", sum/1024/1024) }' |
Windows | ([Math]::round((wmic DiskDrive get Size | findstr /v Size | findstr /v "^$" | Measure-Object -Sum | select Sum | findstr /v "^$" | select -Last 1)/1024/1024/1024)) |
No comments:
Post a Comment