A modern, high-performance Rust implementation of iotop - a tool to monitor I/O usage of processes on Linux.
Install directly from crates.io:
cargo install iotopClone and build from source:
git clone https://github.com/AndPuQing/iotop.git
cd iotop
cargo build --releaseThe binary will be available at ./target/release/iotop.
cargo build --release
sudo cp target/release/iotop /usr/local/bin/
sudo cp doc/iotop.8 /usr/share/man/man8/
sudo mandb # Update man page databasecargo install --path . --root /usr/local
sudo cp doc/iotop.8 /usr/share/man/man8/
sudo mandbiotop requires root privileges to access the kernel's taskstats interface. You have two options:
sudo iotop# Allow iotop to run without sudo by granting the required capability
sudo setcap cap_net_admin+eip /usr/local/bin/iotop
# Now you can run without sudo
iotopFor full functionality (SWAPIN and IO columns), enable kernel delay accounting:
# Temporary (until reboot)
sudo sysctl -w kernel.task_delayacct=1
# Permanent (survives reboot)
echo "kernel.task_delayacct = 1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -pRun interactively:
sudo iotopShow only processes doing I/O:
sudo iotop -oRun in batch mode (5 iterations, 2 second delay):
sudo iotop -b -n 5 -d 2Monitor specific process:
sudo iotop -p 1234Monitor user's processes:
sudo iotop -u www-dataBatch mode with timestamps:
sudo iotop -t -b -n 10 > iotop.log| Option | Long Form | Description |
|---|---|---|
-o |
--only |
Only show processes or threads actually doing I/O |
-P |
--processes |
Show processes instead of all threads |
-a |
--accumulated |
Show accumulated I/O instead of bandwidth |
-d |
--delay |
Delay between iterations in seconds [default: 1.0] |
-n |
--iterations |
Number of iterations before ending (infinite if not specified) |
-b |
--batch |
Batch mode (non-interactive) |
-p |
--pid |
Monitor specific processes/threads (can be repeated) |
-u |
--user |
Monitor processes by username or UID (can be repeated) |
-t |
--time |
Add timestamp on each line (implies --batch) |
-q |
--quiet |
Suppress column names and headers (implies --batch) |
-k |
--kilobytes |
Use kilobytes instead of human-friendly units |
When running in interactive mode (default), you can use the following keyboard shortcuts:
| Key | Action |
|---|---|
q / Q / Ctrl+C |
Quit the program |
o / O |
Toggle showing only processes doing I/O |
a / A |
Toggle between bandwidth and accumulated I/O |
p / P |
Toggle between showing processes and threads |
r / R |
Reverse the current sort order |
Space |
Pause/resume display updates |
Left / Right |
Cycle through sort columns |
Up / Down |
Scroll through process list |
PageUp / PageDown |
Scroll by 10 rows |
Home |
Jump to first sort column (or first row with Ctrl) |
End |
Jump to last sort column (or last row with Ctrl) |
Mouse wheel scrolling is also supported for navigating the process list.
This implementation uses:
- Netlink Taskstats: Interfaces with the Linux kernel's taskstats interface via netlink sockets
- Procfs: Reads process information from
/procfilesystem - Async/Await: Tokio-based async runtime for concurrent data collection
- TUI Framework: Crossterm + Ratatui for terminal rendering
Run the project in development mode:
# Build and run
cargo run -- [options]
# Build in release mode
cargo build --release
# Run tests
cargo test
# Check for issues
cargo clippy
# Format code
cargo fmt
# Run with custom options
cargo run -- -o -d 2MIT License - See LICENSE file for details.
- Original Python implementation: http://guichaz.free.fr/iotop/
- C version by Tomas M: https://github.com/Tomas-M/iotop
- Linux Taskstats documentation: https://www.kernel.org/doc/Documentation/accounting/taskstats.txt
Contributions are welcome! This is an ongoing migration project. Areas for contribution include:
- Additional test coverage
- Performance optimizations
- Documentation improvements
- Bug fixes and feature requests
Please open an issue or pull request on GitHub.