Bash 使用iostat-x和Unix命令获取r/s w/s

Bash 使用iostat-x和Unix命令获取r/s w/s,bash,unix,iostat,system-monitoring,Bash,Unix,Iostat,System Monitoring,我正在从事一个系统监控项目,我想知道在运行iostat-x时如何只返回设备、r/s和w/s列。我确定我必须使用cut-sow-how,但是我试图在这里获得第四列(r/s):iostat-x | cut-f4是不正确的试试这个: iostat -x | awk '{print $4}' 或 iostat -x | sed '1,/Device:/d' | awk '{print $4}'

我正在从事一个系统监控项目,我想知道在运行iostat-x时如何只返回设备、r/s和w/s列。我确定我必须使用cut-sow-how,但是我试图在这里获得第四列(r/s):iostat-x | cut-f4是不正确的

试试这个:

iostat -x | awk '{print $4}'

iostat -x | sed '1,/Device:/d' | awk '{print $4}'