Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»Top Command Output Explained: An Introduction for Beginners

    Top Command Output Explained: An Introduction for Beginners

    By RahulJanuary 31, 20234 Mins Read

    The `top` command is a Linux utility that is used to display real-time information about running processes on a system. It provides a summary of the current state of the system, including the CPU, memory, and swap usage, as well as a list of running processes and their resource utilization.

    Advertisement

    Using the top command is simple: just enter `top` at the command prompt and press Enter. The top command will display a list of running processes, along with their process IDs, CPU and memory usage, and other information. By default, the list is sorted by CPU usage, with the most CPU-intensive processes at the top.

    • Sysstat – Linux System Performance Monitoring Tool
    • Glances – A Real-Time Linux System Monitoring Tool

    Using this article, I am trying to explain understanding and interpreting the Output of the Linux `top` Command

    Understanding and Interpreting the Ouptut of the Linux `top` Command

    The top command is a Linux utility that is used to display real-time information about running processes on a system. When you run the top command, it displays a list of running processes, along with their process IDs, CPU and memory usage, and other information. Here’s how to read and interpret the output of the top command:

    Result Row #1

    Row 1 results show about server uptime from the last reboot, currently logged-in users, and CPU load on the server. The same output you can find using Linux uptime command.

    Linux top command result line 1

    Result Row #2

    Row 2 shows the number of processes running on the server and their state.

    Linux top command result line 2

    Zombie process or defunct process is a process that has completed execution but still has an entry in the process table. This entry is still needed to allow the parent process to read its child’s exit status.

    Result Row #3

    Row three shows the CPU utilization status on the server, you can find here how much CPU is free and how much is utilized by the system.

    Linux top command result line 3

    Steal time is the time that a virtual CPU waits for a real CPU while the hypervisor is servicing another virtual processor.
    Definition from access.redhat.com

    Result Row #4

    Row 4 shows the memory utilization on the server, you can find here how much memory is used, the same results you can find using free command.

    Linux top command result line 4

    Result Row #5

    Row 5 shows the swap memory utilization on the server, you can find here how much swap is being used, the same results you can find using free command.

    Linux top command result line 5

    Result Row #6 ( Running Processes )

    In these steps, you will see all the running processes on servers with additional details.

    Linux top command result line 6

    Short Results Based on Specific Fields

    You can also sort the results based on the specific field. Use the following key combination to do short.

    Press `SHIFT + F` and Select your choice below and press ENTER.

    • A : PID = Process Id
    • b : PPID = Parent Process Pid
    • d : UID= User Id
    • e : USER = User Name
    • f : GROUP = Group Name
    • g : TTY= Controlling Tty
    • h : PR = Priority
    • i : NI = Nice value
    • j : P = Last used cpu (SMP)
    • k : %CPU = CPU usage
    • l : TIME = CPU Time
    • n : %MEM = Memory usage (RES)
    • o : VIRT = Virtual Image (kb)
    • p : SWAP = Swapped size (kb)
    • q : RES= Resident size (kb)
    • r : CODE = Code size (kb)
    • s : DATA = Data+Stack size (kb
    • t : SHR= Shared Mem size (kb)
    • w : S = Process Status
    • x : COMMAND= Command name/line

    Conclusion

    In conclusion, a top command is a powerful tool that is used to display real-time information about running processes on a Linux system. When you run the top command, it displays a list of running processes, along with their process IDs, CPU and memory usage, and other information. By understanding and interpreting the output of the top command, you can get a better understanding of the current state of the system and the resources being used by various processes. With this knowledge, you can use the top command to monitor and manage processes on your Linux system more effectively.

    how to read top command result linux top command result of top command Top top command understand top output understanding top command output
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Understanding 2>&1 in Bash: A Beginner’s Guide

    How to Choose the Best Shebang (#!) for Your Shell Scripts

    Modulus Operator (%) in Bash

    Using Modulus Operator (%) in Bash

    View 16 Comments

    16 Comments

    1. Bile Bakshi on September 10, 2019 3:27 pm

      nicely explain.

      Reply
    2. Debushree Ghosh on July 16, 2019 11:45 am

      Excellent way of explaining. Really useful

      Reply
    3. PradeepS on July 9, 2019 10:28 am

      Clear and crisp. Thank you Rahul

      Reply
    4. Vishweshwar on April 23, 2018 1:57 pm

      Row #2 and Row #3 are same, whereas Row #2 should be Tasks and Row #3 should be CPU(s)

      Reply
    5. siva kumar reddy on December 14, 2017 9:13 am

      Hi

      Please check the typo mistake.(in row3 last line ni–>st).this one helped me much.

      Thank you,
      siva kumar reddy.

      Reply
      • Rahul K. on January 22, 2018 6:03 am

        Thanks Siva, Image has been updated.

        Reply
    6. pradeep on July 10, 2017 5:53 am

      Neat work and well explained. Thank you for this KM.

      Reply
    7. Seshagiri Kondaveti on April 12, 2016 12:39 pm

      Very informative , thanks for sharing it.

      Reply
    8. Abhimanyu Singh on December 20, 2015 4:01 pm

      Awesome explanation, however %ni has been repeated twice which should be %st : steal time in the CPU Usage Section. Please correct it.

      Thanks
      Abhimanyu Singh

      Reply
    9. Tushar on July 30, 2015 10:01 am

      Very nice explanation but some more description of fields

      Reply
    10. Chris on January 21, 2015 8:32 pm

      You are missing a key point or am i?

      In result row #1 you have the load averge of cpu time in 1min, 5min and 15min.

      Results are:
      3.48 @ 1min.
      4.98 @ 5min.
      4.11 @ 15min.

      but what those there number mean.? it cannot be a readout of the CPU load averge over 1min, you CPU would be idle most of the time if the averge load is 3.48, on my linux machine this number is less than 1.

      So wtf is it?!?!?.

      Well it’s not like your Windows friendly view, it’s linux and thank god.

      It’s hard to explain and maybe someone else can do it better but here goes.

      Lets say your system is running with a 4 core CPU, on a Windows PC you would see the 4 cores and the average load each sec.

      You can’t simply move one thing to another core, just like you can’t walk through two doors at the same time.
      However my wife would arguing this.

      We can’t do two things at the same time, but if we have two doors, why not send one thing through one door and another through the next and so on.

      Btw a CPU with hyperthreading is not a core…!

      So lets say it’s a 4 core CPU, and we have the same average load of 3.48 the first minute, then 4.98 every 5 minute and 4.11 every 15minute.

      We can translate this to 3 of the cores are at 100% load, and one if at 48%.
      However this is not true, as we cannot see each core, but the totalt amount so we can only guess.

      This should tell you that there is still a good 52% left on one core, and we don’t need to raise an alarm depending on the average load every 5 or 15min.
      Now every 5min we have a load over 4. It’s 4.98 and i lost you again.

      If we have 4 core where every core can max at 1 why do we have above 4 on a 4 core system?

      Well this counter is so much more, it’s current load or a givin load over a time, it’s the amount the system would like to utilize over a givin periode of time.
      WTF.! stop plz.

      Yeah i know, if only it was Windows and we could all die in a puddel of licens.
      Install htop, it would give you a more “user friendly” view.

      On debian you should just apt-get install htop
      redhat users should add repoforge anyway.

      Now that we know our system is overloaded, how can we fix it?

      By using top to see what is hooking all the CPU time.

      Hope you can update you’re guide to include what these numbers mean as they are not the amount of CPU load in %

      You can find this number on a linux machine with this command cat /proc/cpuinfo | grep ‘model name’ | wc -l

      Reply
      • MH on June 17, 2017 7:34 pm

        Hey,

        This article seems to basic informative with variable explanations within top command, why are you arguing with load values. Also please specify why your are specifying overload with 4 core! Does the article mentioned in such a way!!!

        Last but not least, Please do manner in your replies….:)

        Reply
    11. yellaiah on November 29, 2014 3:37 pm

      Nice explanation. people can understand very easily even he/she does not know.

      Reply
    12. Ganesh on November 5, 2014 2:18 pm

      Very nice explanation but still you can explain in detail about swap size,cached size,Buffer size etc..

      Reply
    13. prasad on December 9, 2013 9:51 am

      u given a clear explanation, so please update the other commands also like this.

      Reply
    14. Rohit Gupta on December 7, 2013 8:13 pm

      Very nice and clearly explained…… thanks for sharing this…..

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.