Unix Top Command and sorting by CPU Usage


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unix Top Command and sorting by CPU Usage
# 1  
Old 11-28-2006
Unix Top Command and sorting by CPU Usage

Ok, so I am using the Top command on my linux VPS to try and see the processes using the most CPU %.

I hit the P to sort by CPU % but it wants to sort them from lowest to highest (ascending). My Telnet-SSH screen is only about 60 rows high so the processes with the highest CPU % usage are at the bottom and I can't see them!

How can I get the CPU % to sort from highest to lowest (descending)?

Thank you!
# 2  
Old 11-28-2006
Versions differ greatly, but isn't CPU% (highest to lowest) the default sort order? If so, are you sure you aren't reversing the sort (making it lowest to highest) when you hit "P"?
# 3  
Old 11-28-2006
No it's not the default sort order on my system and it does not toggle ascending or decending when hitting "P" again (like one would expect).

Any ideas on how I can see the processes using the largest CPU % with the TOP command? It is crucial that I monitor this right now because my VPS is having issues, I just need to know how to see it! All help is appreciated :-)
# 4  
Old 11-28-2006
Error

Ok, so here is my TOP output (processes list)...

Image

I really must see the processes that matter, not the ones showing only 0.0% CPU usage! There are over a 100 processes, so how can I get a look at all of them, or my original question, sort them decending?
# 5  
Old 11-29-2006
Quote:
Originally Posted by davemehta
Just a bump to see if people can help me solve my problem... how can I see all my processes. Actually I just need to see the one's actually using the highest CPU %.
If you are interested for a particular's user process alone
With top,
just give u <> username
# 6  
Old 10-19-2008
On my Mac, this does the trick:

Code:
top -o cpu

# 7  
Old 06-18-2009
(i know this is a stale thread)
FYI: With top v3.2.5, you can reverse the current sort-order with R. O (capital o) shows a menu from which you can select the sort order you want.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Sorting top command output in HP_UX 11.11

Hello all, I've been woking on Solaris and Linux (Red Hat) so far but now I've inherited an HP-UX system and having minor issues with syntax...Appreciate if you could help me out here.. 1) I'm trying to sort the output of the top command in HP-UX 11.11 by pressing O (capital O) after typing... (2 Replies)
Discussion started by: luft
2 Replies

2. UNIX for Dummies Questions & Answers

HOWTO - Total memory and CPU usage ... without top?

Hi all, Is it possible to get total memory usage and free memory usage without top? By Googling I found for total memory usage, use vmstat, for CPU, use mpstat, for disk I/O use iostat, is this correct? Will using sar gives the same result as ALL of these three (3) commands? What about if I... (2 Replies)
Discussion started by: newbie_01
2 Replies

3. Shell Programming and Scripting

Command to find the Memory and CPU utilization using 'top' command

Hi all, I found like top command could be used to find the Memory and CPU utilization. But i want to know how to find the Memory and CPU utilization for a particular user using top command. Thanks in advance. Thanks, Ananthi.U (2 Replies)
Discussion started by: ananthi_ku
2 Replies

4. Shell Programming and Scripting

How to get the information about cpu idle from top command?

I am using Ubuntu 9.04. I want to write a shell script to get the information about cpu idle from top command at the real time when i call it, compare cpu idle with 20 (20%), if cpu idle > 20 exit 1, vice versa exit 0. Anybody can help me to resolve it ? Thanks alot. (7 Replies)
Discussion started by: huyquocnguyen
7 Replies

5. Red Hat

CPU usage: PS versus TOP - Different output

CPU usage: PS versus TOP - Different output Hi When monitoring a Linux environment with PS command, reported CPU value for a certain process differs, sometimes greatly, from the value seen in TOP. I understood this is not a bug, they report different data. I can't understand the nature... (4 Replies)
Discussion started by: liav
4 Replies

6. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

7. UNIX for Dummies Questions & Answers

top command + %CPU usage exceeds 100%?

Hi there. I was looking at the output from running top and for short amounts of time, when I see all the process running and add up the values in the %CPU column the value exceeds 100% (I just add them quickly in my head). I assume that if I were to add up all my processes in the entire list,... (2 Replies)
Discussion started by: Carl1976
2 Replies

8. Linux

Help pinpointing high HTTPD CPU usage in TOP

Hi, new here and need some help. Sometimes my site is extremely slow, if when there aren't too many people on, whereas when there are over 300 online members the site may be very fast. We use CentOS, PHP 5.26. The server has 4GB and Plesk usually shows about 2 or 3 GB free. I believe I can see... (4 Replies)
Discussion started by: pspace
4 Replies

9. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

10. UNIX for Advanced & Expert Users

unix top command (memory usage)

in unix when i use top i get an output like this: load averages: 0.64, 0.57, 0.53 14:04:42 347 processes: 1 running, 1 waiting, 169 sleeping, 172 idle, 4 stopped CPU states: 16.4% user, 2.8% nice, 7.6%... (2 Replies)
Discussion started by: gfhgfnhhn
2 Replies
Login or Register to Ask a Question