How to show top five CPU consuming processes with ps?
|
Why use If you must use
If you want something that's truly 'top'esq with constant updates, use watch
|
|||||||||||
|
|
I don't think If you have GNU-Top, try using it's batch mode to spit out a process list sorted by cpu usage and using head/tail to get the top 5 lines (the first 8 are headers):
The BSD top seems to behave differently and doesn't have a non-interactive mode, so use one of the other |
|||||||||||
|
|
Depending on your needs you may find this a little more readable:
sample output:
|
|||
|
|
|
|
|||
|
|
