linux commands to get informaion about hardwarwe code example

Example: linux commands to get informaion about hardwarwe

//Note that these commands may only work on Debian based distros
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

Some similar commands:
df -h       : Check the status of the various drives on your computer.
lscpu		: It is an easy way to get CPU information.
free        : Show the amount of (remaining) RAM.