Description Of Top Command In Linux

Posted By : Vishnu Gaur | 26-Dec-2017

Depth description of TOP command:--->>

top command is used to check load on server.

I think you are aware of top command and but i am explaining top command in detail.

top command output description.

Row 1 :

   . server time
   . How long the server has been running
   . no. of users
   . Load average
   
The Load average have three sections which
shows the server load time for the last 1,5 and 15 minutes

Row 2 :

   . Total no. of Tasks
   . No. of running tasks
   . No. of sleeping tasks
   . No. of stopped tasks
   . No. of zombie tasks

Row 3:

   . Cpu usage (%) percentage by the user (us)
   . Cpu usage (%) percentage by the system (
sy)
   . Cpu usage (%) percentage by the low priority processes(ni)
   . Cpu usage (%) percentage
by the idle processes (id)
   . Cpu usage (%) percentage
by the io wait (wa)
   . Cpu usage (%) percentage
by the hardware interrupts (hi)
   . Cpu usage (%) percentage
by the software interrupts (si)
   . Cpu usage (%) percentage
by the steal time (st)

Row 4:

   . Total memory
   . Free memory
   . Memory used
   . Buffer cache


Row 5:

    . Total swap memory available
    . Total swap memory free
    . Total swap memory used
    .
Cached Memory

Main table which have 11 columns. I will explain one by one.

 

Column 1 :

      . Process ID of the particular service.


Column 2:

       . User (which user running a particular service it may be root or any other server user.)

Column 3:

       . Priority


Column 4:

       . Nice level (which is decide priority of service. we can set nice value of running process i will describe later)

Column 5:

       . Virtual memory used by a particular process

Column 6:

       . Resident memory used by a particular process

Column 7:

        . Shareable memory

Column 8:
 
        . CPU used by a process

Column 9:

        . Memory used by a process

Column 10:

        . Time process has been running


Column 11:

        . Command which is running a process.

 

Some useful example of TOP command:--->>

 

top -u (username)

It show only processes that are running by (username).


  . Press z will display running processes in colours.
  . Press c will
shows the absolute path of running processes
  . Change delay and
screen refresh time interval in TOP command press 'd' and set (by default is 3sec.
  . Kill a process press 'k' and kill any process without exit top command
  . Renice a process press 'r' and give value without exit top command
  . save top command output result

    top -n 1 -b > output.txt

  . Press 'h' for help
  . Exit top command after repetition
To get a list of the columns with which you can sort the top command by type the following:

    top -O

There are a lot of columns so you might wish to pipe the output to less as follows:

    top -O | less
    top -n 10 (no. of repetition)


 list of the columns  which we can sort the top command by type the following:

    top -O

to sort the %MEM & %CPU uses by below commands.


 top -o %MEM
 top -o %CPU

 

   

About Author

Author Image
Vishnu Gaur

Vishnu Gaur Is DevOps Engineer in oodles technologies, He is a certified Engineer. His hobbies are reading Books and exploring New places

Request for Proposal

Name is required

Comment is required

Sending message..