Skip to content

iostat MacOS Command Guide

The MacOS iostat command provides essential information about system input/output statistics, helping users monitor disk and CPU performance. With various options like -C, -w, -c, and -d, users can customize the output to display specific metrics. By analyzing disk utilization, CPU idle time, and other key indicators, users can optimize system performance and identify bottlenecks effectively. Ideal for system administrators, the iostat command is a powerful tool for performance tuning and troubleshooting on MacOS.

iostat Syntax:

Terminal window
iostat [interval] [count]

Options:

OptionDescription
-CPrint output in a condensed format.
-cPrint individual CPU utilization.
-dDisplay disk utilization report.
-hOutput in a human-readable format.
-nReport network utilization.
-tInclude the time of day in the report.
-wReport statistics for I/O devices.
-xReport extended disk statistics.

Parameters:

ParameterDescription
intervalSpecifies the time in seconds between each report. Default is 1 second.
countIndicates the number of reports generated at intervals determined by the interval parameter. If count is not specified, iostat will continue to run until interrupted.

iostat Command Samples:

Display CPU Utilization

Terminal window
iostat -c

Displays CPU utilization statistics.

Monitor Disk I/O Activity

Terminal window
iostat -d

Monitors disk I/O activity.

Display System Load Average

Terminal window
iostat -w 2

Displays system load average every 2 seconds.

Show Interrupts

Terminal window
iostat -i

Displays the interrupt statistics.

Display Network I/O Statistics

Terminal window
iostat -n

Displays network I/O statistics.

Monitor CPU Utilization in Real-Time

Terminal window
iostat -C 5

Monitors CPU utilization in real-time every 5 seconds.

Display All Statistics Together

Terminal window
iostat -z

Displays all statistics together.

iostat FAQ:

How do I use iostat in MacOS?

To use the iostat command in MacOS, execute the following command:

Terminal window
iostat

What is the purpose of the -w option in iostat?

The -w option in iostat is used to set the interval between each report’s output. This allows you to control how often the statistics are displayed.

Terminal window
iostat -w 5

How can I display extended disk I/O statistics with iostat?

To display extended disk I/O statistics with iostat, use the -d flag in the command. This will provide detailed information about disk operations.

Terminal window
iostat -d

How to show CPU statistics in iostat for MacOS?

To display CPU statistics in iostat for MacOS, use the -c flag in the command. This will show details on CPU usage and activity.

Terminal window
iostat -c

Can I monitor specific disk partitions with iostat?

Yes, you can monitor specific disk partitions with iostat by specifying the partition(s) you want to track. Use the -n flag followed by the partition name(s) in the command.

Terminal window
iostat -n disk1 disk2

How to continuously monitor system input/output statistics with iostat?

To continuously monitor system input/output statistics with iostat, use the -t flag in the command. This will display a timestamp for each report.

Terminal window
iostat -t

Applications of the iostat command

  • Monitoring system input/output (I/O) device loading
  • Analyzing disk performance
  • Troubleshooting disk bottlenecks
  • Tracking disk utilization and throughput