bash - how to extract the remaining memory from free using awk? -


i need extract available memory output free , thought use awk , came free | awk '{print $4}'. gives me output like:

$ free | awk '{print $4}' shared 365296 1273812 3931364 

mind, title shared isn't title of these numbers, numbers free (/usr/bin/free has no title in first column, numbers free appear in 4th column title reported 5th). however, having this, how return second line? i'm not interested in rest now.

free | awk 'nr==2 {print $4}' 

nr, row/line number


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -