■vmstat実行時に実行時間も表示させる方法
vmstat 1 | awk '{print strftime("%H:%M:%S"), $0}'
以下の様に出力されます。
-------------------------------------------------------------------------------------------------------
10:05:28 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
10:05:28 r b swpd free buff cache si so bi bo in cs us sy id wa st
10:05:28 1 0 484348 90884 149632 1578356 0 0 66 89 0 0 3 1 86 10 0
10:05:29 0 0 484348 90884 149632 1578356 0 0 0 184 1162 2680 0 0 92 8 0
10:05:30 0 1 484348 90884 149632 1578356 0 0 0 352 1208 2811 0 0 92 9 0
10:05:31 0 1 484348 90884 149632 1578356 0 0 0 228 1171 2947 0 0 91 8 0
10:05:32 1 1 484348 90884 149640 1578348 0 0 0 192 1177 2993 0 0 91 9 0
10:05:33 0 3 484348 90900 149652 1578336 0 0 0 264 1161 2934 0 0 90 10 0
10:05:34 0 1 484348 90900 149660 1578356 0 0 0 236 1193 2766 0 0 90 10 0
-------------------------------------------------------------------------------------------------------