In Linux, the
top command is an interactive utility that provides a real-time,
dynamic view of the processes running on a system. It displays information about
CPU, memory, and other resources, allowing users to monitor system performance
and manage processes effectively. With
top, users can identify
resource-intensive tasks and make informed decisions on system resource
To use the
top command, simply type
top in your terminal and press Enter.
You will be presented with a real-time updating list of the active processes and
their resource usage.
top command display is divided into two sections. The top section provides
a summary of the system's current state, including uptime, load average, and the
number of tasks. The bottom section lists individual processes and their
Information Fields and Their Descriptions
Here is a table detailing the common information fields displayed by
what each field represents:
|Process ID, a unique number assigned to identify each process.
|The owner or the user who started the process.
|Priority of the process.
|Nice value, a user-space way to set priority of a process.
|Virtual Memory Size of the process (includes all memory).
|Resident Memory Size, the actual amount of physical memory used.
|Shared Memory Size, the amount of shared memory used by a task.
Z (zombie), etc.
|The percentage of CPU used by the process.
|The percentage of RAM (physical memory) used by the process.
|Total CPU time used by the process since it started.
|The command that started the process, including command-line options.
Practical Usage of
top is running, you can interact with it using various commands:
kallows you to kill a process by entering its PID.
ufollowed by a username shows only processes owned by that user.
rallows you to change the priority (nice value) of a process.
Command Keys For the
top is running, users can interact with it using a variety of shortcut
keys to access different features or manipulate the display. Here’s a list of
available shortcuts and their functions in the
|Displays help screen showing almost all the commands available.
|Kills a process. User is prompted to enter the PID of the process to be killed.
|Renices a process. User is prompted to enter the PID of the process to be reniced.
|Displays only the processes owned by a specified user.
|Allows the user to configure the number of processes to be displayed.
|Sorts the processes by memory usage.
|Sorts the processes by CPU usage.
|Sorts the processes by time/cumulative time.
|Toggles command line/command name display.
|Toggles between different memory information displays.
|Toggles between different CPU information displays.
|Enters the field select mode, allowing you to add, remove, or re-order columns/fields.
|Changes the memory scaling factor, cycling between kibibytes (KiB), mebibytes (MiB), gibibytes (GiB), and tebibytes (TiB).
|Toggles the display of load average and uptime information.
|Changes the delay between updates (screen refresh rate).
|Highlights the sorted column.
|Toggles the display of the running tasks in the summary area.
|Toggles bold enable/disable.
|Writes the current setup to the
~/.toprc file, making it the default for future sessions.
|Moves the sorting column one to the left.
|Moves the sorting column one to the right.
|Shows or sets the delay (in seconds) between updates.
|Trees view of processes, showcasing the parent-child relationships.
|Toggles the display of threads.
|Allows user to locate a string within
Each of these shortcuts can help users to swiftly and efficiently navigate
top command, manipulate its displays, or perform specific actions
on processes, enabling more effective system monitoring and management.
top command in Linux is a powerful and interactive tool to monitor
processes and system resources. It provides a real-time view of the system’s
performance, allowing users to identify resource-consuming processes and manage
system load efficiently. Understanding the information provided by
knowing how to interpret it is crucial for maintaining a healthy and responsive
Linux system. By mastering
top and its various features, users and
administrators can optimize resource allocation, troubleshoot issues, and ensure
smooth system operation.
What Can You Do Next 🙏😊
If you liked the article, consider subscribing to Cloudaffle, my YouTube Channel, where I keep posting in-depth tutorials and all edutainment stuff for software developers.