比如 sar 命令的默认输出是这样:
02:20:40 PM CPU %user %nice %system %iowait %steal %idle 02:30:40 PM all 3.67 0.00 0.96 0.00 0.00 95.36 02:40:40 PM all 4.27 0.00 1.40 0.01 0.00 94.32 02:50:40 PM all 2.34 0.00 0.85 0.00 0.00 96.80 我想格式化成这样:
%user %nice %system %iowait %steal %idle 3.67 0.00 0.96 0.00 0.00 95.36 4.27 0.00 1.40 0.01 0.00 94.32 2.34 0.00 0.85 0.00 0.00 96.80 也就是不要每行开头的时间以及 cpu 那一列,而且要能支持间隔一定时间持续输出的那种使用方式。
