linux - Extracting %CPU usage from VMSTAT in a file -
i tried "vmstat > file.txt" -->works fine , output comes file.
when tried extract column cpu ie "vmstat 5 | awk '{print $13}' > file.txt" -->didn't work , no output being written.
how can extract column cpu usage file ?
i had couple of problems. first vmstat
columns can garbled if not use -w
switch. secondly used cut data, buffering, had include stdbuf
in command disable buffering
vmstat 5 -w | stdbuf -o0 cut -c84- > file.txt
Comments
Post a Comment