Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I display the top results in my terminal in real time so that the list is sorted by memory usage?

share|improve this question

2 Answers 2

Use quick tip using top command in linux/unix


hit Shift + f, then choose the display to order by memory usage by hitting key n then press Enter. You will see active process ordered by memory usage.

Or you can just press M after running the top command.



share|improve this answer
Does not work for me –  jan Mar 5 at 11:09

The command line option -o (o standing for "Override-sort-field") also works on my Xubuntu machine and according to the Mac man page of top it should work on a Macintosh too. If I want to short by memory usage I usually use

top -o %MEM

which sorts by the column %MEM. But I can use VIRT, RES or SHR too. On a Macintosh I would probably use mem or vsize.

I don't know why or how but this is pretty much different between Unix systems and even between Linux distributions. For example -o isn't even available on my Raspberry running Wheezy. It may be worth give it a try though.

share|improve this answer
The answer could user more clarity: %MEM is given as an answer to the eager reader; while it doesn't work everywhere (by far). –  7heo.tk May 6 at 15:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.