Friday, July 13, 2012

vmstat + awk = kung fu

Found a way to use awk to parse out a single value from a vmstat command:


vmstat | awk '{ for (i=1; i<=NF; i++) if ($i=="si") { getline; print $i }}'

0 comments:

Post a Comment