Sort By Memory In Top Command on Linux

Updated: Feb 4

Top is a very powerful command to periodically display a sorted list of system processes. The default sorting key is %CPU on Linux. Below we collect 3 ways to sort processes by memory.


3 Ways to Sort by Memory in Top Command

  1. press shift+m after running the top command

  2. sort mem usage per process in the interactive menu. More details below.

  3. run command top -o +%mem

Sort By memory Usage per-process in the interactive menu

  • press Shift+f to enter the interactive menu

  • press the up or down arrow until the %MEM choice is highlighted

  • press s to select %MEM choice

  • press enter to save your selection

  • press q to exit the interactive menu


Related:

Which Process Use the Highest CPU Memory On Linux


1,163 views

Join our newsletter. Get a free Linux account on Cloud.

Get a Free Cloud Server! 

We can use this cloud server to practice Linux commands. Never miss a post!

Thanks for submitting!