iostat
Processes and system
Usage
iostat -x <interval>Shows per-disk throughput and how long requests wait; the first block is an average since boot, Linux needs the sysstat package, and macOS takes different flags such as `-w 1 -c 5`.
Common flags
| Flag | Meaning |
|---|---|
| -x | Extended per-device stats including %util and await (Linux, sysstat). |
| -d | Device lines only, no CPU block. |
| -m | Report in megabytes per second. |
| -h | Human-readable layout (newer sysstat). |
| -w 1 -c 5 | Interval and count on macOS/BSD, which uses different flags. |
Examples
iostat -xh 2Per-disk load every two seconds; the first block is an average since boot (Linux).
iostat -w 1 -c 5Five one-second samples on macOS.
What is running and what is eating the machine. Identifying it comes before killing it.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does iostat do?
Shows per-disk throughput and how long requests wait; the first block is an average since boot, Linux needs the sysstat package, and macOS takes different flags such as `-w 1 -c 5`.
Q. How do I type it?
iostat -x <interval> — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
5 are listed here; the full set is in man iostat. This command sits under Processes and system.
Related commands
man page: man iostat