iostat command is used to find CPU usage and other connected Input/Output devices.

  • iostat command is useful for evaluating the performance of I/O devices, and their efficiency.
  • It is also helpful for monitoring CPU Usage.

How to Install iostat command?

By default, iostat command is already installed in Linux/Unix. If it is not installed, you can install iostat command using the following command.

For fedora/ Red Hat/ CentOS

yum install sysstat

For Ubuntu / Debian / Linux Mint

sudo apt-get install sysstat

Syntax for iostat command

iostat [option] [device-name]

Uses of iostat command with example

CPU utilization report

iostat command without any argument display CPU utilization report.

 

iostat

iostat command in linux

Display report in Human readable format

iostat -h

iostat -h command in linux

iostat -x

iostat -x command in linux

iostat -xd

iostat -xd command in linux

iostat -N

iostat -N command in Linux

Display CPU usage only

By default iostat command displays reports of CPU and I/O device. But, you can restrict the iostat command to display CPU usage only. To display CPU usage only, use iostat -c command.

iostat -c

iostat -c command in linux

Display CPU usage only at a fixed time interval

You can also restrict iostat command to automatically display only CPU usage reports at a fixed time interval. To display CPU usage reports at a fixed time interval, follow the following syntax.

iostat -c INT

Here INT is a fixed time interval in seconds. Do not forget to change INT with your desired time interval. Here I am using 20 for INT. So, my final command will be iostat -c 20. This command will display the CPU usage report every 20 seconds interval.

iostat -c 20

iostat -c 20 command in linux

Display I/O device report in MegaBytes

iostat -m

iostat -m command in linux

Display I/O device report in KiloBytes

iostat -k

iostat -k command in linux

Display I/O device report in KiloBytes at fixed time interval

iostat -k 20

iostat -k 20 command in linux

Display the report of block devices

iostat -p

iostat -p command in linux

Display the report of block devices in MegaBytes

iostat -pdm

iostat -pdm command in linux

iostat -d

iostat -d command in linux

iostat -d sda7 sda6 2 3

iostat -d sda7 sda6 2 3 command in linux

iostat -j ID mmcbkl0 sda6 -x -m 3 2

iostat -j ID mmcbkl0 sda6 -x -m 3 2 command in linux

iostat -o JSON

iostat -o JSON Command in linux

 

Sharing is Caring
Scroll to Top