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
Display report in Human readable format
iostat -h
iostat -x
iostat -xd
iostat -N
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
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
Display I/O device report in MegaBytes
iostat -m
Display I/O device report in KiloBytes
iostat -k
Display I/O device report in KiloBytes at fixed time interval
iostat -k 20
Display the report of block devices
iostat -p
Display the report of block devices in MegaBytes
iostat -pdm
iostat -d
iostat -d sda7 sda6 2 3
iostat -j ID mmcbkl0 sda6 -x -m 3 2
iostat -o JSON
A |
| adduser | addgroup | alias | anacron | apt | aptitude | arp | at | atq | atrm | awk |
B |
| basename | banner | batch | bc | bg | bzip |
C |
| cat | cal | cd | chgrp | chown | cksum | chmod | clear | cmp | comm | cp |
D |
| date | dd | df | diff | dir | dmidecode | du |
E |
| echo | eject | env | exit | expr |
F |
| factor | find | free |
G |
| grep | groups | gunzip | gzip |
H |
| head | history | hostname | hostnamectl | htop | hwclock | hwinfo |
I |
| id | ifconfig | ionice | iostat | ip | iptables | iw | iwlist |
J |
K |
| kill | kmod |
L |
| last | less | ln | locate | login | lp | ls | lshw | lscpu | lsof | lsusb |
M |
| man | mdsum | mkdir | more| mv |
N |
| nano | nc | neofetch | netcat | netstat | nice | nmap | nproc |
O |
| openssl |
P |
| passwd | pidof | ping | pr | ps | pwd | pstree |
Q |
R |
| rdiff-backup | reboot | rename | rm | rmdir | rnmod |
S |
| scp | shred | shutdown | sleep | sort | split | ssh | stat | su | sudo | sum |
T |
| tac | tail | talk | tar | tee | time | tree | top | touch | tr |
U |
| unalias | uname | uniq | unzip | uptime | users |
V |
| vim | vi |
W |
| w | wall | watch | wc | wget | whatis | whereis | which | who | whoami |
X |
| xargs |
Y |
| yes | youtube-dl |
Z |
| zcmp | zdiff | zip | zz |















