I am trying to do following:
Get output of free -mo , take the 2nd line and log it to a file every 30 seconds.
When I run
$free -mo -s 30
$ free -mo -s 30 | head -2 | tail -1
head -2 returns only the first 2 lines of output then quits.
tail -1 returns the last line, then quits. When any program quits in a pipeline, it kills the entire pipeline, so
free is stopped when