free -m currently puts out something like this. I would like to know using grep/awk how we can get the total free amount. i.e. 9083
Print total free memory from `free -m`
linux;grep;string
Using awk:awk '/^-/ {print $4}' <(free -m)9083Be aware that in procps-ng 3.3.10, the output format changes, and this line will then look like:awk '/Mem:/ {print $4}' <(free -m)9083The amount of available memory can be accessed in the newer procps-ng in a different field:awk '/Mem:/ {print $7}' <(free -m)