Command Line Basics: Monitor Processes With Top

There are many different GUI based process monitors available for Linux systems. It seems that each desktop environment or window manager has its own solution. The one common process monitor is the command line terminal based top command.

Give it a try. To run top, simply open a terminal window and enter:

[term]top[/term]

By default, top displays your running processes sorted by CPU usage. The display will get updated every three seconds (again, by default). Here are some basic interactive commands to get you started.

  • q – this is used to Quit using top.
  • z – this toggles color mode.
  • k – this is used to Kill a process. Invoking this command will open a field to enter the PID of the process you want to kill. After that, a field will display asking for the signal you want to send to the process. Simply hit <Enter> at this prompt unless you want to send a different signal to the process.
  • M – change the sort to %MEM.
  • P – change the sort back to %CPU.

There are several more command line parameters and interactive commands that can be used with top. To learn more, check out the top man page.

[term]man top[/term]

3 thoughts on “Command Line Basics: Monitor Processes With Top

  1. Jayachandran

    Also try the followings in “top” console.

    Window 1:Def: Cumulative mode Off. System: Delay 3.0 secs; Secure mode Off.

    Z,B Global: ‘Z’ change color mappings; ‘B’ disable/enable bold
    l,t,m Toggle Summaries: ‘l’ load avg; ‘t’ task/cpu stats; ‘m’ mem info
    1,I Toggle SMP view: ‘1’ single/separate states; ‘I’ Irix/Solaris mode

    Thanks,
    Jai
    f,o . Fields/Columns: ‘f’ add or remove; ‘o’ change display order
    F or O . Select sort field
    . Move sort field: ” next col right
    R,H . Toggle: ‘R’ normal/reverse sort; ‘H’ show threads
    c,i,S . Toggle: ‘c’ cmd name/line; ‘i’ idle tasks; ‘S’ cumulative time
    x,y . Toggle highlights: ‘x’ sort field; ‘y’ running tasks
    z,b . Toggle: ‘z’ color/mono; ‘b’ bold/reverse (only if ‘x’ or ‘y’)
    u . Show specific user only
    n or # . Set maximum tasks displayed

    k,r Manipulate tasks: ‘k’ kill; ‘r’ renice
    d or s Set update interval
    W Write configuration file
    q Quit

    Reply
  2. Pingback: fsdaily.com

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.