shell

iostat (BSD)

iostat shows I/O statistics. The example below shows statistics of the copying process from an USB music player to my laptop’s hard drive. It shows KB per transfer, transfers per second and MB per second, for each device specified in the first row in the statistics report). The last three columns show CPU statistics. You can avoid them with the -d flag.

iostat -w 1
      tty             ad0              da0              da1             cpu
 tin tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
  15   71 18.85   7  0.13   7.77   1  0.00   0.01   0  0.00   5  0  2  0 93
   1  231 61.40  73  4.37  62.48  73  4.45   0.00   0  0.00   1  0 19  1 80
   0   77 61.55  71  4.26  62.10  70  4.24   0.00   0  0.00   2  0 25  0 73
   0   77 61.77  71  4.28  62.42  72  4.38   0.00   0  0.00   1  0 24  4 71
   0   77 62.10  83  5.03  62.41  80  4.87   0.00   0  0.00   1  0 14  1 84
   0   77 62.18  87  5.28  62.76  87  5.32   0.00   0  0.00   0  0  5  0 95
 144   77 64.00  86  5.37  64.00  86  5.37   0.00   0  0.00   2  0  3  0 95
  80   77 61.84  73  4.40  62.70  74  4.53   0.00   0  0.00   1  0 27  0 72
   0   77 60.24  84  4.94  62.13  82  4.97   0.00   0  0.00   1  0 10  1 89
   0   77 52.82  92  4.77  64.00  64  3.97   0.00   0  0.00   1  0 33  0 66
   0   77 61.29  76  4.55  62.45  75  4.57   0.00   0  0.00   1  0 23  2 74
 216   77 62.03  80  4.84  63.59  78  4.84   0.00   0  0.00   1  0 13  1 86
   0   77 62.03  80  4.84  62.82  79  4.84   0.00   0  0.00   0  0 13  1 86
   0   77 62.05  81  4.90  62.71  79  4.83   0.00   0  0.00   0  0 16  1 83
 152   77 61.95  77  4.65  63.36  75  4.64   0.00   0  0.00   2  0  9  0 89
  40   77 61.89  75  4.51  62.70  76  4.63   0.00   0  0.00   2  0 24  0 74
  80   77 60.19  75  4.41  62.49  72  4.39   0.00   0  0.00   6  0 23  1 70
  69  123 61.86  74  4.47  61.86  76  4.59   0.00   0  0.00   5  0 14  0 82
 136   77  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   2  0  0  0 98
 288   77  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0  0  1  0 99

The -w 1 sets the refresh interval to 1 second. Use -c num to specify how many times you wan to update the information you want displayed.
I find iostat more useful with gnu-watch
Enjoy!

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*Required Fields