Sort by memory with `top` command?

QuestionsQuestions8 SkillsProDec, 21 2025
0335

To sort by memory usage while the top command is running, you can use a simple keyboard shortcut:

  1. Open top in your terminal:
    top
  2. Press M (Shift + m).

The list will immediately refresh, placing the processes using the most memory at the top of the list (ordered by the %MEM column).

Other Useful Shortcuts:

  • P: Sort by CPU usage (default).
  • R: Reverse the sort order (e.g., from lowest memory usage to highest).
  • q: Quit and return to the terminal.

Try it now in your LabEx VM! It's a great way to see which applications are consuming the most resources.

0 Comments

no data
Be the first to share your comment!