Categories: TutorialsUbuntu

iostat Command in Linux

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:

Using
Sponsored
iostat command

To display monitoring reports:

$ iostat

Output:

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

2. 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

Sponsored

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:

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

$ iostat -d

Output:

3. -x: displaying the detailed report

$ iostat -x

Output:

4. -m: displaying reports in MegaBytes

$ iostat -m

Output:

5. -k: displaying reports in kiloBytes

$ iostat -k

Output:

6. -p: displaying device block report

$ iostat -p

Output:

Conclusion

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

Thank you for referring!

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.

Ubuntu Server Admin

Recent Posts

AI in 2025: is it an agentic year?

2024 was the GenAI year. With new and more performant LLMs and a higher number…

7 minutes ago

Canonical announces 12 year Kubernetes LTS

Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…

1 day ago

Ubuntu Weekly Newsletter Issue 878

Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…

2 days ago

How your feedback shapes the way we support open source software

At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…

2 days ago

How To Install osTicket v1.14 On Ubuntu 20.04

I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…

3 days ago

How To Install WordPress On Ubuntu 20.04

Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…

3 days ago