A simple way to understand the IOStat command

User Avatar
πŸ‘€ admin
πŸ”΄ Admin
✍️ The most important thing in the world is to not be alone.
⏳ Last active: 15 Apr 2025 at 16:01
πŸ“… Created: 17 Mar 2022 at 16:58
πŸ‘€ Viewed: 19 times
βœ‰οΈ Send Email

Introduction

The iostat command in Linux allows users to monitor system i/o statistics on the device. It is based on how long the devices are operating at the average baud rate to monitor the input/output of the system. Based on reports, system configurations can be changed to optimize CPU performance. This command is in the sysstat package.

Now we’re gonna teach you to use the iostat command in Linux.

Installing sysstat package

Since the iostat command is in the sysstat package, you need to install it:


$ sudo apt install sysstat

Output:

Image

Using iostat command

To display monitoring reports:


$ iostat

Output:

Image

In the output, you can see the CPU report and Device report.

Parameter:

  1. CPU

%user: % CPU usage

%nice: % CPU usage with nice priority

% system: % CPU usage at the system level

%iowait: % of CPU time idle and system request i/o

%steal: % virtual CPU waiting while another virtual processor is serving the hypervisor

%idle: % CPU time idle and no system request i/o

  1. Device

Device: the I/O device name

tps: the transfers per second

kB_read/s: the amount of data CPU read per second in kiloBytes (kB)

kB_wrtn/s: the amount of data CPU written per second in kiloBytes (kB)

kB_dscd/s: the rate of data CPU discarded per second in kiloBytes (kB)

kB_read: the total number of blocks read

kB_wrtn: the total number of blocks written

kB_dscd: the total number of blocks discarded

The syntax of the iostat command


$ iostat [option] [device-name]

option:

  1. -c: displaying summary of monitoring reports

$ iostat -c

Output:

Image

  1. -d: displaying I/O devices report only

$ iostat -d

Output:

Image

  1. -x: displaying the detailed report

$ iostat -x

Output:

Image

  1. -m: displaying reports in MegaBytes

$ iostat -m

Output:

Image

  1. -k: displaying reports in kiloBytes

$ iostat -k

Output:

Image

  1. -p: displaying device block report

$ iostat -p

Output:

Image

Conclusion

We just taught you to use the iostat command in Linux.

Another interesting article may be: How To Make A Temporarily Folder In Ubuntu Using MKTemp

If you want to comment: Login or Register