I need to extract the available memory from the output free
and I thought I would use awk and came up with something like free | awk '{print $4}'
.
Which gives me an output like:
$ free | awk '{print $4}'
shared
365296
1273812
3931364
mind, the title shared isn't the title of these numbers, the numbers are from free (/usr/bin/free
has no title in the first column, thus the numbers for free appear in the 4th column where the title reported is from the 5th). However, having this, how do I only return the second line? I'm not interested in the rest for now.
Just figured it out myself, it can be accomplished using: