The iotop
command is a powerful tool that allows users to monitor disk I/O usage by processes in real-time. It provides a dynamic view of which processes are consuming the most disk resources, helping to identify bottlenecks and optimize system performance.
The basic syntax of the iotop
command is as follows:
iotop [options] [arguments]
-o
, --only
: Show only processes or threads actually doing I/O, which can help focus on active processes.-b
, --batch
: Run in batch mode, useful for logging output to a file.-n NUM
, --iter NUM
: Set the number of iterations before exiting.-d SEC
, --delay SEC
: Set the delay between updates in seconds.Here are some practical examples of using iotop
:
iotop
to view real-time disk I/O.
iotop
iotop -o
iotop
in batch mode and log the output to a file for later analysis.
iotop -b -n 10 > iotop_log.txt
iotop -d 2
iotop
for a specific number of iterations, e.g., 5.
iotop -n 5
iotop
with root privileges to ensure you can see all processes and their I/O usage.iotop
with other monitoring tools like top
or htop
for a comprehensive view of system performance.