Sort processes by CPU Usage

ps aux | sort -rk 3,3 | head -n 10
Short list about top 10 processes, sorted by CPU usage
Sample Output
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      9878  2.4  0.0 944296  7588 ?        Ssl  Sep03 2010:47 dad
admbd     1282  1.0  0.0  64212  3984 pts/46   S+   17:01   0:00 ssh frutillar
root      1279  0.4  0.0  64208  3984 pts/77   S+   17:01   0:00 ssh desacloud522
root      1278  0.4  0.0  64208  3976 pts/129  S+   17:01   0:00 ssh f1cloud4099
root      1281  0.3  0.0  82488  4524 ?        S    17:01   0:00 /usr/sbin/packagekitd
root     10238  0.3  0.0  55048  8992 ?        Ssl  Sep03 244:21 /opt/CA/SystemEDGE/bin/sysedge -b
root     11321  0.2  0.1 278880 25168 ?        Sl   Sep03 170:44 splunkd -p 8089 start
root     10086  0.1  0.0 165280 12364 ?        Ssl  Sep03 102:49 /usr/sbin/adclient
appdyn     514  0.1  0.0 112432  2736 ?        S    16:58   0:00 sshd: appdyn@pts/130

1
By: x3mboy
2018-10-29 20:00:36

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: