How to display `top` results sorted by memory usage in real time?

If you're using the top that comes with Ubuntu (top -v = procps-ng version 3.3.10),

then you can use these interactive keyboard shortcuts to change the sorting. Note that these are all capital letters, so either use shift or caps lock.

M %MEM
N PID
P %CPU
T TIME+

By default, they will be sorted in DESC order. Use R to toggle ASC/DESC.

To set the sorting from the command line option, use top -o %MEM. You can specify any column.

posted @ 2019-08-29 14:16  johnsonshu  阅读(158)  评论(0编辑  收藏  举报