iotop Command in Linux with Examples
Last Updated :
06 Sep, 2024
The ‘iotop’ command is a powerful Linux tool designed for monitoring disk Input/Output (IO) usage in real-time. It provides a comprehensive view of the current disk IO activities by processes, making it invaluable for system administrators who need to track down processes that are causing high disk IO, potentially impacting system performance. Written in Python, ‘iotop’ requires specific kernel modules and a Python interpreter for execution, typically needing root privileges.
This tool’s functionality is similar to the top command, but it specifically focuses on disk IO operations. With ‘iotop’, you can easily identify processes that are reading from or writing to disk, allowing for efficient troubleshooting of performance issues related to disk IO.
Installation of iotop
1. For CentOS/RHEL
sudo yum install iotop
2. For ubuntu
sudo apt install iotop
How to Use the ‘iotop’ Command
1. List Processes and Their Current Disk IO Usage
To get the list of processes and their current disk IO usage.
sudo iotop

This command will now display the list of processes and their current disk usage and will keep on updating the same.
2. Show Processes Actually Performing IO Operations
To show processes that are actually doing IO
sudo iotop -o

This will display all the processes which are currently and actually doing IO.
3. Check the Version of iotop
To get the version of the ‘iotop’
sudo iotop --version

This will display the currently installed version of iotop tool.
4. Display Help Information
To display help section
sudo iotop -h

This command will display the help section of the iotop tool.
5. Run iotop in Non-Interactive Mode
To display output in non interactive mode
sudo iotop -b

This will display the output in non-interactive and batch mode.
6. Limit the Number of Updates
To change the number of iterations or updations
sudo iotop -n 3

This command will not update the output 3 times in spite of the default time which is infinity.
7. Display IO Usage for a Specific Process
To monitor a specific process by its PID, use:
sudo iotop -p 10989

This will display the IO usage of the process with the mentioned PID in spite of all the processes.
8. Show Accumulated IO Usage Over Time
To show accumulated output
sudo iotop -a

This will not display the accumulated IO instead of bandwidth.
9. Add Timestamps to the Output
To add a time stamp to each line
sudo iotop -t

This will add a time stamp to each line of the output.
10. Suppress Header Lines for a Cleaner Output
To suppress some lines of header
sudo iotop -q

This will now suppress some line of header in the output.
Conclusion
The iotop command is a valuable tool for Linux system administrators who need to keep an eye on disk IO usage. It shows real-time information about which processes are accessing the disk, making it easier to spot and fix any performance issues related to high disk IO.
By learning the different commands and options that iotop offers, you can customize your monitoring to fit your specific needs, whether it’s viewing real-time data interactively or logging information with timestamps for later review. Using iotop regularly as part of your system maintenance can help you keep disk usage in check, catch potential problems early, and keep your system running smoothly.
Similar Reads
iconv command in Linux with Examples
The iconv command is used to convert some text in one encoding into another encoding. If no input file is provided then it reads from standard input. Similarly, if no output file is given then it writes to standard output. If no from-encoding or to-encoding is provided then it uses current local's c
3 min read
id command in Linux with examples
The 'id' command in Linux is a powerful tool used to display user and group names along with their numeric IDs (User ID - UID or Group ID - GID) of the current user or any specified user on the system. This command is particularly useful for system administrators and users who need to verify user id
3 min read
if command in linux with examples
if command in Linux is used for conditional execution in shell scripts.The if command is essential for writing scripts that perform different actions based on different conditions. if COMMANDS list is executed, if its status is true, then the then COMMANDS list is executed. Otherwise, each elif COMM
4 min read
ifconfig Command
Knowing your IP address is fundamental for network administration, troubleshooting, and various Linux system tasks. In this article, we will explore several methods to find your IP address in a Linux environment. Whether you are a seasoned Linux user or just getting started, understanding these meth
10 min read
iftop command in Linux with Examples
The 'iftop' command is a powerful network analysis tool used by system administrators to monitor real-time bandwidth usage on network interfaces. It provides a quick and detailed overview of networking activities, helping diagnose network issues by identifying which applications or processes are con
4 min read
ifup command in Linux with Examples
The 'ifup' command in Linux is essential for managing network interfaces, allowing them to transmit and receive data by bringing them up. This command is typically used in conjunction with network configuration files, specifically '/etc/network/interfaces', which contain the necessary definitions fo
3 min read
import command in Linux with Examples
import command in Linux system is used for capturing a screenshot for any of the active pages we have and it gives the output as an image file. You can capture a single window if you want or you can take the entire screen or you can take a screenshot of any rectangular portion of the screen. Here, w
4 min read
info command in Linux with Examples
info command reads documentation in the info format. It will give detailed information for a command when compared with the man page. The pages are made using the Texinfo tools which can link with other pages, create menus, and easy navigation. Here, we will explore the functionality of the info com
3 min read
insmod command in Linux with examples
insmod command in Linux systems is used to insert modules into the kernel. Linux is an Operating System that allows the user to load kernel modules on run time to extend the kernel functionalities. LKMs(Loadable Kernel Modules) are usually used to add support for new hardware (as device drivers) and
3 min read
install command in Linux with examples
The 'install' command in Linux is a versatile tool used for copying files and setting their attributes, such as permissions, ownership, and group. Unlike commands like 'cp' that simply copy files, 'install' allows you to fine-tune these settings, making it ideal for installation scripts or manual fi
3 min read