Home·Terminal commands

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

FlagMeaning
-xExtended per-device stats including %util and await (Linux, sysstat).
-dDevice lines only, no CPU block.
-mReport in megabytes per second.
-hHuman-readable layout (newer sysstat).
-w 1 -c 5Interval and count on macOS/BSD, which uses different flags.

Examples

iostat -xh 2

Per-disk load every two seconds; the first block is an average since boot (Linux).

iostat -w 1 -c 5

Five 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