vmstat

vmstat (virtual memory statistics) is a computer system monitoring tool that collects and displays summary information about operating system memory, processes, interrupts, paging and block I/O.

Users of vmstat can specify a sampling interval which permits observing system activity in near-real time.

The vmstat tool is available on most Unix and Unix-like operating systems, such as FreeBSD, Linux or Solaris.

In the above example the tool reports every two seconds for six iterations.

We can get the customized or required outputs by using various options with the vmstat command.