I am trying to parse the output of a command df -h. For instance:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VGExaDb-LVDbSys1
30G 17G 12G 58% /
/dev/sda1 496M 38M 433M 8% /boot
/dev/mapper/VGExaDb-LVDbOra1
99G 18G 76G 19% /u01
tmpfs 252G 90M 252G 1% /dev/shm
dbfs-dbfs_user@:/ 4.0T 283G 3.7T 8% /dbfs_direct
I need values ββonly in the "Free" column. But the command awkdoes not work the way I wanted, because the number of words in each line is not the same. When I run the command df -h | awk '{print $4}', it outputs the result as follows:
Avail
58%
433M
19%
252G
3.7T
source
share