You can sort the processes displayed in the top
command by memory usage using the following steps:
- Open the
top
command: Runtop
in your terminal. - Press
Shift + M
: This will sort the processes by their memory usage. - Toggle sorting order: To sort by memory usage in descending order (highest memory usage first), press
Shift + M
again.
This will allow you to quickly identify processes consuming the most memory on your system.