o7planning

Use Top Command - Task Manager for Ubuntu

  1. Top Command
  2. Show Helps
  3. Add/remove Fields
  4. Change the order of the Fields
  5. Sort on Field
  6. Sort by CPU
  7. Display Specific User Processes
  8. Highlight Running Processes
  9. Shows Absolute Path of Processes
  10. Kill a process

1. Top Command

When you are familiar with Task Manager in the Windows OS, you will wonder if there is something similar to Task Manager in Ubuntu Server or not.
In Windows, Task Manager is a utility program allowing you to know which application is running on the system and resources it uses
Ubuntu supplies you with a similar program, however its interface is very rudimentary. The application is called as "Top Command".
To run "Top Command", you run the top command:
Top Command:
Note: To exit "Top Command", press 'q'.

2. Show Helps

You need press 'h' to see Helps, and press "ESC" to return to the main screen.

3. Add/remove Fields

There are lots of Fields you can care for. By default, "Top Command" only displays some Fields. Press 'f' to add or remove Fields:
The Fields with (*) are the displayed fields, other ones don't display on "Top Command".
Use up or down arrow keys to move to the the desired Field.
  • Press ENTER.
  • Press Whitespace to select or deselect Field.
Press "ESC" to return to the main screen.

4. Change the order of the Fields

It will be more visible when you change the order of the Field on the screen of the "Top Command".
Press 'f' to see a list of Fields.
  • Press the right arrow key to mark the Field that need to move.
  • Press the up/ down arrow to move the Field marked above to another location.
  • Press ENTER to complete it.
Press "ESC" to return to the main screen.

5. Sort on Field

Assume that you want to know which program is using the most memory, you need to sort it by %MEM (% Memory).
Press 'f' to see the list of Fields.
  • Select the Field to sort.
  • Press 's'.
  • Press "ESC" to return to the main screen.

6. Sort by CPU

CPU is an important field, it tells you which Process enables computer to process the most at the moment. Press "Shift + P" to sort by CPU.

7. Display Specific User Processes

Use the option '-u' allowing you to specify user and to view which process is executed by this user.
top -u user_name
For example, see the processes that are executed by user 'tran':

8. Highlight Running Processes

Press 'z', the program "Top Command" will display processes running with the colors. This helps you to identify the running processes easily.

9. Shows Absolute Path of Processes

When the processes are running, if you want to see the absolute path of the files that execute those processes, you need to press 'c':

10. Kill a process

In Windows, you can finish a running task by using "End Task".
On Ubuntu, you can use "kill" to kill a process.
  • Press 'k'.
  • Enter PID (Process ID).
  • Press ENTER.