0% found this document useful (0 votes)
5 views2 pages

02 Linux Process System Monitoring

The document provides a comprehensive guide on Linux process and system monitoring commands, detailing how to inspect, manage, and control processes as well as monitor system resources. Key commands include 'ps', 'top', 'free', and 'df', each serving specific functions for performance tracking. Additionally, it explains how to interpret load averages to assess system utilization and potential bottlenecks.

Uploaded by

sumesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

02 Linux Process System Monitoring

The document provides a comprehensive guide on Linux process and system monitoring commands, detailing how to inspect, manage, and control processes as well as monitor system resources. Key commands include 'ps', 'top', 'free', and 'df', each serving specific functions for performance tracking. Additionally, it explains how to interpret load averages to assess system utilization and potential bottlenecks.

Uploaded by

sumesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Linux Process & System Monitoring

Commands and Techniques to Track Performance & Resources

Monitoring Processes
Understanding what's running on your system is fundamental to Linux administration. Use these
commands to inspect, manage, and control processes.

Command Description

ps aux Show all running processes with CPU and memory usage

ps aux --sort=-%cpu Sort processes by CPU usage (highest first)

ps aux --sort=-%mem Sort processes by memory usage

top Interactive real-time process viewer

htop Enhanced interactive process viewer (install with apt)

pgrep nginx Find PID of a process by name

kill -9 PID Force-kill a process by its PID

killall firefox Kill all processes with the given name

nice -n 10 command Run command with lower CPU priority

renice -n 5 -p PID Change priority of a running process

nohup command & Run command that survives logout

jobs List background jobs in current shell

bg %1 Resume job 1 in the background

fg %1 Bring job 1 to the foreground

System Resource Monitoring


Command Description

free -h Show RAM and swap usage in human-readable format

df -h Disk usage of all mounted filesystems


du -sh /var/log/ Size of a specific directory

du -sh * | sort -h Sort directories by size

vmstat 1 5 System stats every 1 second, 5 times

iostat -x 1 Disk I/O statistics per second

uptime Show load averages and system uptime

lscpu Detailed CPU architecture information

lsmem Show memory range and block info

lsblk List all block devices (disks, partitions)

dmesg | tail -20 Last 20 kernel messages

journalctl -xe View systemd journal with explanations

Interpreting Load Averages


The uptime command shows three load averages: 1-minute, 5-minute, and 15-minute. A value of 1.0 on
a single-core system means 100% utilization. On a 4-core system, 4.0 means full utilization. Values
consistently above the number of CPU cores indicate a bottleneck.

✓ Rule of thumb: If the 1-min load is much higher than 15-min, load is increasing. If it's lower, the
system is recovering.

You might also like