Daniel Menelkir
Tech stuff and everything else

Sort CPU usage

I don’t know if this works in any unix, but for me works in AIX and Linux.
Sorting CPU usage:

# ps -eo pid,user,%cpu,args --sort %cpu

Source: Kairo Araujo

2 Responses to “Sort CPU usage”

  1. The following is more cross-platform and almost as good:

    ps -eo pcpu,pid,user,args

    The sort option and the use of % are not universal, but you can pipe the output to something else if you really have a lot of processes.

  2. Thank you very much!
    This was exactly what I was looking for!

    Except I wanted mine to be reverse sorted and smaller so:

    # ps -eo pid,user,%cpu,args –sort -%cpu | head


Leave a Reply