$linuxjunkies
>

dstat(1)

dstat is a versatile replacement for vmstat, iostat, netstat and ifstat that displays system resource statistics in real-time with customizable output.

UbuntuDebianFedoraArch

Synopsis

dstat [options] [delay [count]]

Description

dstat gathers and displays detailed information about system resources including CPU, memory, disk I/O, network traffic, and processes in a single, colored, real-time view. It updates periodically (default 1 second) and can log data to files or CSV format for analysis.

Unlike traditional tools, dstat combines multiple monitoring sources and allows custom plugins for extended functionality. The output is highly configurable and defaults show the most commonly monitored metrics.

Common options

FlagWhat it does
-cdisplay CPU statistics (user, system, idle, wait)
-ddisplay disk I/O statistics (read/write rates)
-ndisplay network statistics (send/receive rates)
-mdisplay memory statistics (used, buffer, cache, free)
-gdisplay page statistics (in/out)
-pdisplay process statistics (runnable, new processes)
-ldisplay load average statistics
-sdisplay swapping statistics
--output FILEwrite output to a file for later analysis
--csvoutput data in CSV format for spreadsheets
-a, --allshortcut for -cdngs (CPU, disk, network, page, swap)
--nocolordisable colored output

Examples

display default metrics (CPU, disk, network, paging) updating every 1 second

dstat

show time, CPU, memory, and swap statistics with timestamp column

dstat -tcms

display disk I/O and utilization percentage, updating every 5 seconds for 10 iterations

dstat -d --disk-util 5 10

log network statistics to CSV file for post-analysis

dstat -n --net --output report.csv

show top CPU and memory consuming processes in real-time

dstat --top-cpu --top-mem

display all common metrics without colors, updating every 2 seconds

dstat -a --nocolor 2

monitor CPU, memory, swap and socket statistics every 3 seconds indefinitely

dstat -tcms --socket 3 0

Related commands