List the 10 Biggest Memory-Hogging Processes

If you want to quickly see what processes are wasting all of your memory, you can do so with a simple command line that filters the output from ps to sort by memory usage, and return only the ten biggest memory hogs.

Naturally, you could use the top command instead, but this is an alternative way to do it:

ps aux | sort -nrk +4 | head

The sort -nrk +4 command is where the magic happens… the -n stands for numeric, the -r is for reverse, and -k starts the sorting on the 4th column in the output. Lastly we pass it through head to just return the first 10 in the list.

This article was written on 07/21/10 Tagged with: Linux

Daily Email Updates

You can get our IT articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Leave a Reply

Our Network
About Sysadmin Geek