Resource monitoring in Linux


CPU Memory usage
- top – Real-time system summary.
- htop:- Interactive process viewer (advanced top).
- vmstat :- System memory, processes, paging, etc.
- free -h :- Memory usage in human-readable format.
- mpstat :- CPU usage (install via sysstat package).
- iostat :- CPU and disk I/O (also from sysstat).
- uptime :- How long the system has been running.
- lscpu :- CPU architecture info.
- numactl —hardware – NUMA node memory info.
- sar :- Collects, reports system activity (install sysstat).
Disk Usage and I/O
- df -h:- Disk space usage.
- du -sh :- Directory size
- lsblk :- List block devices.
- mount :- Mounted filesystems.
- findmnt :- Show mounted filesystems in tree.
- iostat :- Disk I/O statistics.
- iotop :- Real-time disk I/O. (need to use by super user)
- blktrace :- Trace block I/O.
dstat :- Versatile resource statistics.
Process and Services
ps aux
– List all running processes.
pidstat
– Process-level resource usage.
systemctl status
– Check service status.
service
– Manage system services (older systems).
Example of service command is like:- sudo service ssh status
watch
– Run commands repeatedly
example :- watch [options] <Command> like:- watch df -h
Network Monitoring
ip a
– Show IP addresses.
ss -tuln
– Show listening ports.
netstat -tulnp
– (Old but still used).
iftop
– Real-time bandwidth monitor.
nethogs
– Bandwidth per process.
traceroute
– Trace network path
It maps the route packets take to reach a host.
Helps identify network delays or where a connection is failing.
Each line in the output = a router/hop between your system and the target.
ping
– Check network reachability.
dig
ornslookup
– DNS lookup.
File and Log Monitoring
tail -f /var/log/syslog
– Real-time log monitoring.
journalctl -xe
– View systemd logs.
lsof
– List open files.
inotifywait
– Watch for file changes.stat
– Detailed file info.
command :- stat <filename>
Hardware Info
lshw
– List hardware info.lsusb
– USB devices.lspci
– PCI devices.dmidecode
– BIOS/firmware info.sensors
– Hardware temperature sensors.
General System Info
uname -a
– Kernel and system infohostnamectl
– Host and OS details.dmesg | less
– Kernel messages.
Subscribe to my newsletter
Read articles from Sidharth Shukla directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Sidharth Shukla
Sidharth Shukla
I am full stack web developer, currently i am learning devops and cloud technology.