Command Line Basics: Monitor Processes With Top

February 28, 2010 by Linerd
Filed under: HowTo, command line, linux 

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:

top

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.

man top

Comments

One Response to “Command Line Basics: Monitor Processes With Top”

  1. Story added...

    This story has been submitted to fsdaily.com! If you think this story should be read by the free software community, come vote it up and discuss it here:

Leave a Reply