Categories
mac

Mac下的top命令用法

习惯了linux下top命令的p, m快捷键,结果到了mac下不好使,google之原来应该是这样操作:
iTerm下在输入了top命令的界面输入ocpu,则是按照cpu用量排序;输入orsize则是按照内存使用量排序。更多输入项可以输入?查看, 如下

State Command Description
? Display this help screen.
n c Set event counting mode to {a|d|e|n}.
pid o Set primary sort key to : [+-]keyname.
Keyname may be:{pid|command|cpu|csw|time|threads|
ports|mregion|rprvt|rshrd|rsize|vsize|vprvt|pgrp|
ppid|state|uid|wq|faults|cow|user|msgsent|msgrecv|
sysbsd|sysmach|pageins}.
pid O Set secondary sort key to (see o).
q Quit top.
S\n Send signal to pid .
1 s Set the delay between updates to seconds.
on r Toggle the memory map reporting.
U Only display processes owned by , or all.

记之方便以后查询。其实直接通过man top即可了解上面的东西,关键就是个人的懒。。随手记两条。。

top -o cpu // 按cpu排序
top -o +command // 按命令正序