To sort by memory usage while the top command is running, you can use a simple keyboard shortcut:
- Open
topin your terminal:top - 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.