Unveiling the "TOP" command: Analyze your system like a power user.
The output you're seeing in that screenshot corresponds to the top
command, which displays a real-time list of processes and system resource usage in a tabular format. Let’s break down each of the columns so you can see how much information it provides in such a compact space:
Detailed explanation, step by step:
The top section of the top
command output provides an overview of the system status. Here is the breakdown:
System Header:
top - 23:05:14 up 19 min, 1 user, load average: 0.66, 0.40, 0.16
top
: The name of the command.23:05:14
: The current time.up 19 min
: How long the system has been running (in this case, 19 minutes).1 user
: The number of users currently logged into the system.load average: 0.66, 0.40, 0.16
: The system load averages (the number of processes waiting to use the CPU) over the last 1, 5, and 15 minutes. These values indicate how busy the CPU is. A value of 1.0 means the CPU is fully loaded (using all available cores).
Tasks:
Tasks: 400 total, 2 running, 398 sleeping, 0 stopped, 0 zombie
400 total
: The total number of processes (tasks) on the system.2 running
: The number of processes currently running.398 sleeping
: The number of processes in a "sleeping" state, waiting for an event (e.g., input/output or resources).0 stopped
: No manually stopped processes.0 zombie
: No zombie processes (processes that have ended but whose state has not been collected by their parent).
CPU Usage:
%Cpu(s): 0.6 us, 1.0 sy, 0.0 ni, 98.0 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st
0.6 us (user)
: 0.6% of CPU time is being used by user processes (not kernel).1.0 sy (system)
: 1.0% of CPU time is being used by the kernel for system processes.0.0 ni (nice)
: 0.0% of CPU time is being used by processes with adjusted "nice" values (low or high priority).98.0 id (idle)
: 98.0% of CPU time is idle.0.0 wa (iowait)
: 0.0% of CPU time is waiting for input/output operations (disk, network, etc.).0.0 hi (hardware interrupts)
: No hardware interrupts.0.3 si (software interrupts)
: 0.3% of time is used by software interrupts.0.0 st (steal time)
: 0.0% of CPU time is "stolen" by the hypervisor (in virtualized environments).
Memory Usage (RAM):
MiB Mem : 13818.4 total, 3805.2 free, 4028.7 used, 6378.7 buff/cache
13818.4 total
: Total available RAM in the system (in MiB).3805.2 free
: Currently available free memory.4028.7 used
: Memory currently in use.6378.7 buff/cache
: Memory used by the system for buffers and cache, which can be freed if needed. This includes disk cache and system buffers.
Swap Memory Usage:
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 9789.7 avail Mem
8192.0 total
: The total size of swap memory on the system (8 GB in your case).8192.0 free
: Amount of free swap memory (in this case, all swap space is free).0.0 used
: Amount of swap memory used (none in this case).9789.7 avail Mem
: The total memory available for use by processes (this includes free physical memory plus cache that can be freed).
Example:
Your system has 13.8 GB of RAM, of which 3.8 GB is free, 4 GB is in use by processes, and 6.3 GB is used for cache and buffers.
The CPU is mostly idle, with 98% of the time being idle.
You are not using swap memory, which is good since using swap can affect performance.
The lower section displays the following information:
Description of each field:
PID (Process ID)
: The unique identification number assigned to each process on the system.USER
: The user who started or owns the process. For example, in your case, there are several processes run by the usert0ny
.PR (Priority)
: The priority of the process. A lower value indicates higher priority. Real-time priority processes will have anRT
value.NI (Nice value)
: The "nice" value adjusts the priority of the process. A lower value gives more priority, and a higher value gives less. The range is from -20 (higher priority) to 19 (lower priority).VIRT (Virtual Memory)
: The virtual memory used by the process, which includes all the memory the process has reserved, whether it is using it or not. This includes swap usage, memory mapped to files, shared libraries, etc.RES (Resident Memory)
: The portion of memory that is actually stored in RAM and not on disk or swap.SHR (Shared Memory)
: Memory shared with other processes, such as common libraries.S (State)
: The current state of the process. Possible values include:R
: Running.S
: Sleeping - waiting for an event or resource.D
: Uninterruptible sleep - directly waiting for disk access.Z
: Zombie - the process has ended, but its state has not yet been cleaned by its parent.T
: Stopped - the process has been paused.
%CPU
: The percentage of CPU being used by the process at that moment. A high value means the process is consuming many CPU resources.%MEM
: The percentage of total RAM being used by the process. This is based on the resident memory (RES
).TIME+
: The amount of CPU time the process has used since it started. It is displayed in the format hh:mm.COMMAND
: The name of the command or program the process is running. This could be the binary name or an alias representing the running process.
Example:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5991 t0ny 20 0 8918528 535384 172456 S 3.7 3.8 0:39.78 python
The process with PID 5991
, belonging to the user t0ny
, has a priority of 20
and a nice value of 0
.
It is using 8.9 GB
of virtual memory (VIRT
), but only 535 MB
are in RAM (RES
), and 172 MB
of that is shared (SHR
).
It is in state S
(sleeping).
It is currently using 3.7%
of the CPU and 3.8%
of the total RAM.
The command being run is python
and it has used 39.78
seconds of CPU time since it started.
Comments
Post a Comment