| Crates.io | iotop |
| lib.rs | iotop |
| version | 0.2.4 |
| created_at | 2025-10-08 12:17:18.765951+00 |
| updated_at | 2025-10-16 07:00:45.405713+00 |
| description | A Rust implementation of iotop - display I/O usage of processes |
| homepage | https://github.com/AndPuQing/iotop |
| repository | https://github.com/AndPuQing/iotop |
| max_upload_size | |
| id | 1873943 |
| size | 152,571 |
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 iotop
Clone and build from source:
git clone https://github.com/AndPuQing/iotop.git
cd iotop
cargo build --release
The 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 database
cargo install --path . --root /usr/local
sudo cp doc/iotop.8 /usr/share/man/man8/
sudo mandb
iotop 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
iotop
For 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 -p
Run interactively:
sudo iotop
Show only processes doing I/O:
sudo iotop -o
Run in batch mode (5 iterations, 2 second delay):
sudo iotop -b -n 5 -d 2
Monitor specific process:
sudo iotop -p 1234
Monitor user's processes:
sudo iotop -u www-data
Batch 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:
/proc filesystemRun 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 2
MIT License - See LICENSE file for details.
Contributions are welcome! This is an ongoing migration project. Areas for contribution include:
Please open an issue or pull request on GitHub.