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.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.