How to use awk command?
by pad001 from LinuxQuestions.org on (#5GGPG)
Hi Linux experts.
Please I am trying filter the contents of the 'free -m' command using the 'awk' to display column 2(used), and column 3(free) as well as the values directly beneath them but keep failing.
#free -m
total used free shared buff/cache available
Mem: 1458 513 509 11 435 767
Swap: 2047 0 2047
#free -m |head -1 |awk '{print$2,$3}'
used free
I want values of the second line under column used, and free
thank you for your help!!


Please I am trying filter the contents of the 'free -m' command using the 'awk' to display column 2(used), and column 3(free) as well as the values directly beneath them but keep failing.
#free -m
total used free shared buff/cache available
Mem: 1458 513 509 11 435 767
Swap: 2047 0 2047
#free -m |head -1 |awk '{print$2,$3}'
used free
I want values of the second line under column used, and free
thank you for your help!!