in

UbuntuUbuntu

Usage of Top Command in Linux Explained with Terms

View Resource Utilisation by the Processes!!

TOP Command

Top Command in Linux: Top Command provides a real-time view of the Linux processes. It is an interactive command that lets you observe the processes, kill a process and so on. This command allows the user to monitor the list of threads or activities and precise information of the tasks which are presently managed by the Linux Kernel. Furthermore, it will show the usage of memory, processor activity, and other information about current processes. It is one of the most vital tools for a system administrator. In this article, the top command in Linux explained with each and every term of top command execution.

Index:

Top Command to Display Processes:

As you already predicted, you just need to type “top” in the Ubuntu Terminal in order to launch it.

$
top
  • Once you execute the top command, it will start up an interactive command-line application as like the screenshot given below.
    Top Command Usage
    Top Command Usage
  • Browse through the list with the use of arrow keys. Simple press “q” to quit the process.

Description of the Header section:

The Top Command’s display contains a lot of information about the system processes. Initially, you can find the details regarding system time, uptime, load average, CPU usage, memory usage and so on the header section. Now, let us see the description of each term one by one with the representation of screenshots.

Row 1:

Top Command - Row 1
Top Command – Row 1
  • System time: Current time is displayed at the start of the Top command.
  • Uptime: It shows the information about how long your system is active/running.
  • User sessions: Number of active users.
  • Load Average: “Load” is an estimate of the computational effort a system performs. It denotes the CPU average load over 1, 5 and 15 minutes.

Row 2:

Tasks: It displays the statistics of processes/activities currently running on your system.

Top Command - Row 2
Top Command – Row 2
  • 255 Total: The count of the total processes is mentioned as the total value.
  • 4 Running: Current running process.
  • 251 Sleeping: Total actions/processes in sleep mode.
  • 0 Stopped: The total number of processes stopped.
  • 0 Zombie: Total count of processes in a zombie state. It is a process that has concluded execution but still has access to the process table.

Row 3:

CPU Usage: 

Top Command - Row 3
Top Command – Row 3
  • 4.2 us: It is the time taken by CPU to perform processes in userspace.
  • 7.5 sy: Time spent on executing system processes.
  • 0.0 ni: “Nice” value is used to identify the priority of a process. It is the time spent by CPU on executing actions with a manually set “nice”.
  • 87.2 id: It is the time, the CPU remains idle.
  • 0.0 wa: It is the CPU waiting time for the completion of I/O processes.
  • 0.0 hi: Time spent on managing hardware interrupts.
  • 1.1 si: Time spent on handling software interrupts.
  • 0.0 st: The OS will find out when it has a task to do, but it cannot do it as the CPU is busy on some other virtual machine. In such a case, time will be lost while waiting for the CPU response. It is referred to as “steal” time.

Row 4 & 5:

Memory Usage: In this section, it displays the information regarding the memory usage of the system.

Top Command - Row 4 & 5
Top Command – Row 4 & 5
  • As you guess, the values “total”, “free” and “used” have their usual meanings.
  • “Mem” displays information about RAM space.
  • “Swap” denotes swap space.
  • “Buff/cache” shows total cached memory or total memory used by buffers.
  • “Avail Mem” is the total of memory that can be assigned to processes without causing more swap.

Understanding the Task area:

Here, we will learn about the diverse columns present in the task area.

Task Area
Task Area
  • PID: It is the “process id” that recognizes a process.
  • USER: “Username” of the user who began the process.
  • PR: “Priority” of the process.
  • NI: “Nice” value of a process.
  • VIRT: Virtual memory consumption by a process.
  • RES: It is the memory used by the process in RAM.
  • SHR: Amount of memory shared with other processes.
  • S: Shows the current process state.
  • %CPU: CPU usage
  • %MEM: Memory usage
  • TIME+: It is the total CPU time utilized by the process since it commenced.
  • Command: Displays the name of the process.

Check your Top command version:

The top command comes in numerous variants and each has its diverse method of usage and set of options. In order to check your top command version, use the below command.

$
top -v
Top Command Version
Top Command Version

A Short Synopsis:

In the above article, we have explained how to use the top command on Linux Ubuntu 19.10 Eoan Ermine/ 18.04 LTS Bionic Beaver. Furthermore, we have illustrated the terms present at the top command to make you understand clearly. Is this article useful? Don’t forget to share your valuable queries/suggestions in the below comment box.

Check this too  GZip Command in Linux: Essential GZip Command Syntax & Examples

Leave a Reply

Your email address will not be published. Required fields are marked *

Lisa

Written by Lisa

Lisa is a technical writer who assists readers with quality content as part of a Tec Robust team. Her writing helps people from diverse professional backgrounds. Her article makes you gain clarity on technical topics as she knows what is right for you.

supertuxkart

How to install the SuperTuxKart Game on Ubuntu 18.04 LTS/19.10?

Quadrapassel Game

How to Install Quadrapassel Game for Linux Ubuntu 18.04 LTS/ 19.10?