The dstat application is not commonly installed. It will need to be installed with your package manager. It requires Python 2.2 and above, which is installed by default on modern Linux systems:
# apt-get install dstat # yum install dstat
The dstat application displays disk, network, memory usage, and running task information at regular intervals. The default output gives you an overview of the system activity. By default, this report is updated every second on a new line, allowing easy comparison with previous values.
The default output lets you track overall system activity. The application supports more options to track top resource users.
If you encounter the below error while running the command dstat:
dstat: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install dstat |
Ubuntu | apt-get install dstat |
Arch Linux | pacman -S dstat |
Kali Linux | apt-get install dstat |
CentOS | yum install dstat |
Fedora | dnf install dstat |
Raspbian | apt-get install dstat |
dstat Command Examples
1. Display CPU, disk, net, paging and system statistics:
# dstat
2. Display statistics every 5 seconds and 4 updates only:
# dstat 5 4
3. Display CPU and memory statistics only:
# dstat --cpu --mem
4. List all available dstat plugins:
# dstat --list
5. Display the process using the most memory and most CPU:
# dstat --top-mem --top-cpu
6. Display battery percentage and remaining battery time:
# dstat --battery --battery-remain