Sort all running processes by their memory & CPU usage

ps aux --sort=%mem,%cpu
you can also pipe it to "tail" command to show 10 most memory using processes.
Sample Output
root        21  0.0  0.0      0     0 ?        S<   Oct10   0:11 [ata/0]
68        1417  0.0  0.2   6772  2900 ?        Ss   Oct10   0:14 hald   
root      1586  0.0  0.1  17184  1836 ?        Ssl  Oct10   0:14 NetworkManager --pid-file=/var/run/NetworkManager/NetworkManager.pid
root      1554  0.0  0.0   3516   564 ?        S    Oct10   0:19 hald-addon-storage: polling /dev/sr0 (every 2 sec)                  
ali       2013  0.0  0.9 247540 10068 ?        S    Oct10   0:24 kwin -session 10dad4d46f000125200430400000021020032_1255123367_509351
dbus      1377  0.0  0.1  13492  1484 ?        Ssl  Oct10   0:25 dbus-daemon --system                                                 
root        47  0.0  0.0      0     0 ?        S<   Oct10   0:29 [scsi_eh_1]                                                          
ali       2047  0.0  1.5 123976 15816 ?        Rl   Oct10   0:44 yakuake -session 10dad4d46f000125165081500000020800011_1255123367_401521 -name Qt-subapplication
ali       2323  0.1  0.2 1610188 2528 ?        Ss   Oct10   0:52 C:\windows\system32\explorer.exe /desktop                                   
ali       2021  0.1  2.2 287952 23152 ?        Sl   Oct10   1:37 /usr/bin/plasma-desktop
ali       2299  0.2  0.0   5404   992 ?        Ss   Oct10   2:24 /usr/bin/wineserver
root      6341  0.5  7.0 122288 72160 pts/3    S+   00:33   0:33 /usr/bin/python /usr/bin/yum groupinstall GNOME Desktop Environment
ali       2296  0.6  0.7 1694604 8076 ?        Sl   Oct10   5:03 C:\Program Files\www.cproxy.com\cproxy.exe                                  
ali       2191  0.8  0.2 100880  2160 ?        Ssl  Oct10   7:07 /usr/bin/pulseaudio --start --log-target=syslog
ali       6164  1.2  3.2 165432 33084 ?        Sl   00:30   1:20 /usr/bin/kopete -caption Kopete
ali       4854  2.6  2.2 147408 22468 ?        Sl   Oct10   6:07 /usr/lib/nspluginwrapper/npviewer.bin --plugin /usr/lib/mozilla/plugins/libflashplayer.so --connection /org/wrapper/NSPlugins/libflashplayer.so/4759-1
ali       4546  2.9  5.9 228028 61048 ?        Sl   Oct10   7:24 /usr/lib/songbird-1.2.0/./songbird-bin
root      1840  5.9  2.7  55864 28172 tty1     Ss+  Oct10  49:50 /usr/bin/X -br -nolisten tcp :0 vt1 -auth /var/run/xauth/A:0-lhNFjm
ali       4759 16.6 18.4 652080 187640 ?       Sl   Oct10  38:56 /usr/lib/firefox-3.5.3/firefox
ali       7231  2.0  0.0   4764   988 pts/0    R+   02:16   0:00 ps aux --sort=%mem,%cpu

13
By: mrwill
2009-10-10 22:48:51

These Might Interest You

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: