Back to the learning path

vmstat

vmstat = virtual memory statistics Command details
Step 1/1: Samples over time

vmstat INTERVAL COUNT prints a line every INTERVAL seconds: r is processes waiting for the CPU, free is free memory (KB), si/so is swapping, us/sy/id the user, kernel and idle CPU percentages. The first line is the average since boot; the rest cover each interval.

$ vmstat 1 5
Fundamentalsvmstat
Sample once a second
Use vmstat to print a line of memory and CPU figures every second, 2 lines in all, then stop by itself.

This exercise needs real Linux

The commands it uses (processes, networking and more) are not in the simulator. Switch to real Linux and the exercise runs in a real Linux system inside your browser.

lsofNext lesson:strace