How can I print/capture the top 10 io usage? I'm using the iotop -o | head -n 11
but the output keeps changing. I wanted to capture the first output after running it.
Thank you,
How can I print/capture the top 10 io usage? I'm using the iotop -o | head -n 11
but the output keeps changing. I wanted to capture the first output after running it.
Thank you,
RMaaS
-b, --batch
Turn on non-interactive mode. Useful for logging I/O usage over time.
-n NUM, --iter=NUM
Set the number of iterations before quitting (never quit by default). This is most useful in non-interactive mode.
Thus:
iotop --batch -n 1 |head
To execute iotop
only once you need to exec the command on this way:
iotop -n 1|head -n 11
To clear a bit of output you can try something like:
iotop -q -n 1|head -n 11
-q
Commented
Dec 6, 2023 at 5:38