I’m running the following command to get the available space on my HHD. In this case I know the device (/dev/disk0s2).
I’m wondering how to first detect all the HDD’s and then run the df command below to show the available disk space of all HDD’s.
$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s2 112Gi 58Gi 54Gi 52% /
/dev/disk0s3 800Gi 400Gi 400Gi 50% /
df -h | awk '$1=="/dev/disk0s2"{print $4}'
Result: 54Gi
Result I need: disk0s2: 54Gi, disk0s3: 400Gi, etc….
Something like this?