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

$top

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 top command.

References

http://stackoverflow.com/questions/4802481/how-to-see-top-processes-by-actual-memory-usage

share|improve this answer

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 shoult work on a Macintosh too. If I want to short by memory usage I usually use

top -o %MEM

which shorts 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

Your Answer

 
discard

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.