print "$(lsvg -Lo |xargs lsvg -L|grep "TOTAL PPs"|awk -F"(" '{print$2}'|sed -e "s/)//g" -e "s/megabytes/+/g"|xargs|sed -e "s/^/(/g" -e "s/+$/)\/1000/g"|bc ) GB"
This command calculates the total data volume on an AIX machine. It does so by:
1. Running the ‘lsvg -Lo’ command to list all logical volumes.
2. Extracting the «TOTAL PPs» information from the ‘lsvg -L’ output.
3. Using ‘awk’ to extract the value within parentheses.
4. Replacing «megabytes» with ‘+’ and removing ‘)’ with ‘sed’.
5. Performing addition with ‘bc’ and converting it to gigabytes (GB).
Alternative: You can use ‘lsvg’ to get the total physical partition count and the PP size to calculate the data volume manually.
