Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Mar 242008
 

List processes by memory usage

Answer:

To list all of your current system's running processes, and sort by memory usage, try

# ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'

    0 [aio/0]
    0 [ata/0]
    0 [ata_aux]
    0 [cqueue]
    0 [events/0]
    0 [kacpi_notify]
    0 [kacpid]
    0 [kblockd/0]
    0 [khelper]
    0 [kintegrityd/0]
.
.
.
29528 /usr/sbin/apache2 -k start
29536 /usr/sbin/apache2 -k start
29860 /usr/sbin/apache2 -k start
30320 /usr/sbin/apache2 -k start
32588 /usr/sbin/apache2 -k start