Ten TOP Command Examples In Linux Ubuntu

The TOP command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. The types of system summary information shown and the types, order and size of information displayed for processes are all user configurable and that configuration can be made persistent across restarts.

Here are some Top command examples:

If we type ‘top’ in terminal, this is how our output looks. By default, Top command displays the output sorted by CPU usage.
k@sk:~$ top
sk@sk: ~_001
1. Display Processes sorted by Memory usage
To display the Top command output sorted by Memory usage type uppercase letter “M”
sk@sk: ~_002
2. Display all CPU’s in Top command output:
To display all CPU’s(cores) in the Top output press “1″(Number 1).
sk@sk: ~_003
3. Display the path’s of commands and arguments:
To display the path’s of the command press lowercase “c”.
sk@sk: ~_004
4. Split Top command output into multiple segments:
To split out the Top command output into segments press uppercase “A”.
sk@sk: ~_005
5. Kill a process without quitting from Top:
To kill a process without exiting from Top command press lowercase “k”. Enter the PID of process to quit.
sk@sk: ~_006
6. Display particular user output:
To display output sorted by a particular user, use the parameter “-u”.
sk@sk:~$ top -u sk
sk@sk: ~_007
7. Highlight running processes:
To highlight the running processes in the Top command output, press “z”.
sk@sk: ~_008
8. Change Refresh interval of Top command:
By default, the Top command updates the output every 3 seconds. You can change the interval by pressing “s” key. It will ask you to enter the new time interval.
sk@sk: ~_010
9. View help screen without quitting Top command
To view help screen interactively without exiting from Top command press “h” or “?”. Press any key to exit from the help screen.
sk@sk: ~_009
10. Save Top command settings:
If you want to save the changes you have made using the above commands, press uppercase “W”. It saves the settings to ~/.toprc. The changes will be used automatically later.
For more information to know about Top command use man command.
sk@sk:~$ man top
Alternatively you can use “htop” command. It is even better and more powerful than Top command.

The commands that are provided in the above list are the best commands that are generally used by the core users.

so start using the commands in ubuntu..