Linux:如何查看传输到/从硬盘驱动器传输的实时字节数/秒数?

eee*_*eee 14 linux hard-drive

我想在 Linux 上看到类似于 Windows 下的 Perfmon 程序的东西。是否存在这样一种终端友好而不是 gui 程序的东西?谢谢。

小智 21

iostat 就是你要找的:

   iostat - Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions.
Run Code Online (Sandbox Code Playgroud)

像这样调用它会让你每 2 秒获得 KB/s:

$ iostat -k 2

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sdb               0.89         2.39         1.72     189644     136436
sda               5.42        31.79        40.89    2519836    3240543
Run Code Online (Sandbox Code Playgroud)


Hol*_*ust 7

使用iostat. 例如iostat 2将每 2 秒输出一次 io 统计信息。但是请注意,它每秒输出块。通常,一个块为 4 KB,但可能会有所不同,具体取决于所使用的实际块设备。


小智 5

您可能需要每个进程的统计信息:(iostat尽管其他方面非常好)不知道如何做到这一点,但iotop可以。