vmstat

vmstat reports information about memory, paging, processes, disks, block IO, CPU activitiy, and traps.

Installation

When vmstat is not installed by default, it can be added to the system using the relevant software package.

Package information for vmstat

Operating systemPackage nameInstallation
AlmaLinuxprocps-ng
dnf install procps-ng
Arch Linuxprocps-ng
pacman -S procps-ng
Debianprocps
apt install procps
Fedoraprocps-ng
dnf install procps-ng
Red Hat Enterprise Linuxprocps-ng
dnf install procps-ng
Rocky Linuxprocps-ng
dnf install procps-ng
Ubuntuprocps
apt install procps

Your Linux distribution using a different package? Share your feedback.

Usage

Available options

Short optionLong optionDescription
-a--activeActive and inactive memory
-f--forksNumber of forks since boot
-m--slabsSlab information
-n--one-headerHeader displayed once
-s--statsEvent counters and memory statistics
-d--diskDisk statistics
-D--disk-sumDisk activitiy summary
-p--partition deviceStatistics about partition
-S--unit characterChange output unit (k=1000, K=1024, m=1000000, M=1048576)
-t--timestampInclude timestamp with each line
-w--wideWide output, useful when output does not fit
-v--versionVersion information
-h--helpDisplay help

Missing an option in this overview? Share your feedback.

Relevant articles using the vmstat command

The following articles include an example on how to use vmstat and might be worth further exploring.