0% found this document useful (0 votes)
35 views1 page

Week 6

The document provides an overview of various Linux commands for monitoring system memory and CPU usage, including 'cat /proc/meminfo', 'free', 'vmstat', and 'top'. Each command is explained with its purpose and key fields, detailing memory statistics, CPU usage, and process information. The commands help users understand system performance and resource allocation.

Uploaded by

rakesh
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)
35 views1 page

Week 6

The document provides an overview of various Linux commands for monitoring system memory and CPU usage, including 'cat /proc/meminfo', 'free', 'vmstat', and 'top'. Each command is explained with its purpose and key fields, detailing memory statistics, CPU usage, and process information. The commands help users understand system performance and resource allocation.

Uploaded by

rakesh
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

1. cat /proc/meminfo o si / so: Swap-in/swap-out rate.

Explanation: o bi / bo: Disk I/O.


• This command reads and displays memory-related o us: User CPU usage.
statistics from the /proc/meminfo file.
o sy: System CPU usage.
• It provides detailed information about the system's
o id: Idle CPU percentage.
memory usage, including total, free, and available
memory, swap usage, and more.
Key Fields: 4. top
• MemTotal: Total system memory. Explanation:

• MemFree: Unused memory. • top displays real-time information about system


processes, CPU usage, memory usage, and system
• MemAvailable: Estimated available memory. load.
• Buffers: Memory used by block device buffers. • It updates dynamically.
• Cached: Data cached in RAM. Key Fields:
• SwapTotal: Total swap space. • Tasks: Total, running, sleeping, zombie processes.
• SwapFree: Free swap space. • %Cpu(s): CPU usage breakdown (user, system,
idle, etc.).
2. free
Explanation: • KiB Mem: Total, free, used, and cached memory.
• The free command displays memory usage • KiB Swap: Total, free, and used swap space.
information.
5. top -H
• By default, it shows the total, used, and free Explanation:
memory in RAM and swap.
• This is the same as top, but with the -H flag to
• The -h option makes it human-readable. show individual threads instead of just processes.
Key Fields: • Each thread ID (TID) is listed separately.
• total: Total RAM.
• used: Memory in use. 6. top --a
Explanation:
• free: Unused memory.
• top --a sorts processes by most active resources.
• shared: Memory used by shared processes.
• This option is not standard in all Linux
• buff/cache: Buffers and cache memory.
distributions.
• available: Estimated available memory.
• If supported, it prioritizes CPU-intensive processes
3. vmstat in the display.

Explanation: • Processes with high CPU usage appear at the top.

• vmstat reports system performance statistics.


• It shows CPU usage, memory usage, swap activity,
disk IO, and system load.
• Running vmstat 1 updates the statistics every
second.
Key Fields:
o r: Number of processes waiting for CPU.
o b: Blocked processes.
o swpd: Swap memory used.
o free: Free RAM.
o buff: Buffer memory.
o cache: Cached memory.

You might also like