GNU/Linux Getting System Information Statistics about CPU, Memory, Network and Disk (I/O operations)


Example

To get general statistics about main components of Linux family of stat commands are extremely useful

CPU

To get processors related statistics you can use mpstat command but with some options it will provide better visibility:

$ mpstat 2 10

Memory

We all know command free to show amount of (remaining) RAM but to see all statistic including I/O operations:

$ vmstat 2 10

Disk

To get general information about your disk operations in real time you can utilise iostat.

$ iostat -kx 2

Network

To be able to see what is happening with your network services you can use netstat

$ netstat -ntlp # open TCP sockets 
$ netstat -nulp # open UDP sockets 
$ netstat -nxlp # open Unix sockets 

But you can find useful monitoring to see network traffic in real time:

$ sudo iftop

Optional

To generate statistics in real time related to I/O operations across all components you can use dstat. That tool that is a versatile replacement for vmstat, iostat and ifstat