Top Command Basics
What is the Top Command?
The top
command is a powerful built-in utility in Linux systems that provides real-time dynamic view of running processes. It offers system administrators and developers a comprehensive overview of system resource utilization, CPU usage, memory consumption, and process management.
Key Features of Top Command
Feature |
Description |
Process Monitoring |
Displays active processes and their resource consumption |
Real-time Updates |
Continuously refreshes system performance metrics |
Resource Tracking |
Shows CPU, memory, and swap space usage |
Sorting Capabilities |
Allows sorting processes by various parameters |
Basic Syntax and Usage
top
Understanding Top Command Output
graph TD
A[Top Command Output] --> B[Header Section]
A --> C[Process List]
B --> D[System Load]
B --> E[CPU Statistics]
B --> F[Memory Usage]
C --> G[Process Details]
- System uptime
- Number of users
- Load average
- CPU and memory statistics
Process List Columns
- PID: Process ID
- USER: Process owner
- %CPU: CPU usage
- %MEM: Memory usage
- TIME+: Cumulative CPU time
Interactive Top Command Options
Key interactive commands:
P
: Sort by CPU usage
M
: Sort by memory usage
T
: Sort by time
q
: Quit top command
Practical Example
## Launch top command
top
## Sort processes by CPU usage
## Press 'P' after launching top
LabEx provides an excellent environment for learning and practicing Linux system administration, including advanced process monitoring techniques using the top
command.