I am running following command and getting following output which I am saving into file.
sysstat/iostat -mdt sda1 1 >> /tmp/disk.out &
Outout is following
Linux 3.16.0-25-generic (bscpower8n2) 09/25/2016 _ppc64le_ (192 CPU)
09/25/2016 08:12:01 PM
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda1 0.00 0.00 0.00 1 0
09/25/2016 08:12:02 PM
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda1 0.00 0.00 0.00 0 0
09/25/2016 08:12:03 PM
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda1 0.00 0.00 0.00 0 0
09/25/2016 08:12:04 PM
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda1 0.00 0.00 0.00 0 0
09/25/2016 08:12:05 PM
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda1 0.00 0.00 0.00 0 0
09/25/2016 08:12:06 PM
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda1 0.00 0.00 0.00 0 0
But I want to save it without header and datetime also in same row. Could anyone let me know how to achieve this? e.g
09/25/2016 08:12:01 PM sda1 0.00 0.00 0.00 1 0
09/25/2016 08:12:02 PM sda1 0.00 0.00 0.00 0 0
`iostat -1 -c 2 -d sdb | tail -n 2 | head -n 1`
In your `do ... while` loop you can add the date etc. β Phillip Mar 23 '22 at 16:37