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.

猜你喜欢

转载自www.cnblogs.com/johnsonshu/p/11429425.html