Featured

    Featured Posts

Top command

The top command is, like ps, used to display running processes, but with one very neat feature: it updates its display every few seconds. By default, top sorts its entries by CPU use but you can sort the entries by other columns as well. top is very useful to find out which users and processes are consuming the most system resources at any given time.
Here is an example of the top window:
linux top command
As you can see from the picture above, the top command displays a variety of information about processes. Here is a brief description of the most important ones:
PID – the process ID of the task
USER – task’s owner
PR – the priority of the task
NI – the nice value of the task
VIRT – the total amount of virtual memory used by the task
RES – the non-swapped physical memory the task has used
%CPU – the task’s share of the CPU time
%MEM – the task’s share of the physical memory
COMMAND – the command used to start the task
Sorting the top output
By default, top sorts its entries by CPU usage. You can change that by pressing “M” to sort by memory usage. To reverse sort your output, press “R“. To return to sorting by CPU, press “P“. To sort by other fields press “<” to moves the sort column to the left and “>” to move the sort column to the right.
NOTE – to get help, type “h“.
Killing processes with top
You can also use top to kill processes. For example, in the picture above we can see that the dd task is using 99.2% of the CPU time. That could indicate a problem. If we want to kill that process, we would simply type “k” and provide the PID of the process we are trying to kill, in this case 8156.
NOTE – to exit top, press “q“.
author

Author Name

Author Description!

Get Free Email Updates to your Inbox!

Post a Comment

www.ccna.ma

yu
Powered by Blogger.

Translate

Copyright © Learn Linux Th3pro.xyz | Blogger Templates | Designed By Code TAOUSSI