The Linux top command is a useful tool for checking the performance of your system and the processes running on it. The top command displays various information such as CPU usage, memory usage, load average, process ID, user, command, and more. You can also use the top command to perform some actions on the processes, such as changing their priority, sending signals, or killing them.
In this article, we will explain how to use the Linux top command and some of its options and features.
To run the top command, simply type `top` in your terminal and press Enter. You will see a screen similar to this:
Linux top Command Running in a Terminal Window
The top command output consists of two parts: the header and the body. The header shows the summary of the system information, such as the time, the uptime, the number of users, the load average, the CPU usage, the memory usage, and the swap usage. The body shows the list of processes sorted by CPU usage by default.
You can use the arrow keys or the Page Up and Page Down keys to scroll through the list of processes. You can also use the Home and End keys to jump to the beginning and the end of the list.
PID: unique process id.
USER: owner of task.
PR: The process’s priority. The lower the number, the higher the priority.
NI: Nice Value of the task.
VIRT: amount of virtual memory used by the task.
RES: amount of physical RAM the process is using, measured in kilobytes.
SHR: Represents the Shared Memory used by a task.
S: Status of the process
%CPU: Represents the share of CPU usage.
%MEM: Shows the share of Memory usage of task.
TIME+: total CPU time in hundredths of a second.
COMMAND: The name of the command that started the process.
The status of the process can be one of the following:
D: Uninterruptible sleep
I: Idle
R: Running
S: Sleeping
T: Stopped by control signal
Z: Zombie
The top command has many options and features that allow you to customize the output and the behavior of the command. Here are some of the most common ones:
The top command is a powerful and versatile tool for monitoring and managing the processes on your Linux system.
Some common use cases and scenarios where the top command can help are:
To learn even more about the top command and its features, you can refer to the following resources:
This link is being provided as a convenience and for informational purposes only it is not an endorsement or an approval of any of the products, services or opinions of the corporation or organization or individual.
Hostingorservers.com bears no responsibility for the accuracy, legality or content of the external site or for that of subsequent links.