shell杂谈(四):top指令的使用

Android top指令的使用

usage: top [-Hbq] [-k FIELD,] [-o FIELD,] [-s SORT] [-n NUMBER] [-m LINES] [-d SECONDS] [-p PID,] [-u USER,]


Show process activity in real time.


-H    Show threads
-k    Fallback sort FIELDS (default -S,-%CPU,-ETIME,-PID)
-o    Show FIELDS (def PID,USER,PR,NI,VIRT,RES,SHR,S,%CPU,%MEM,TIME+,CMDLINE)
-O    Add FIELDS (replacing PR,NI,VIRT,RES,SHR,S from default)
-s    Sort by field number (1-X, default 9)
-b    Batch mode (no tty)
-d    Delay SECONDS between each cycle (default 3)
-m    Maximum number of tasks to show
-n    Exit after NUMBER iterations
-p    Show these PIDs
-u    Show these USERs
-q    Quiet (no header lines)


Cursor LEFT/RIGHT to change sort, UP/DOWN move list, space to force
update, R to reverse sort, Q to exit.

输出示例

Tasks: 1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
  Mem:      7.3G total,      7.1G used,      198M free,      135M buffers
 Swap:      2.0G total,      1.5G used,      441M free,      2.0G cached
800%cpu  36%user   2%nice  44%sys 711%idle   0%iow   5%irq   2%sirq   0%host
  PID USER         PR  NI VIRT  RES  SHR S[%CPU] %MEM     TIME+ ARGS
^C179 u0_a645      10 -10 6.0G 229M 123M R 12.3   3.0   2:57.84 com.langogo.tra+

Mac 上的 top指令

top usage: top
        [-a | -d | -e | -c <mode>]
        [-F | -f]
        [-h]
        [-i <interval>]
        [-l <samples>]
        [-ncols <columns>]
        [-o <key>] [-O <secondaryKey>]
            keys: pid (default), command, cpu, cpu_me, cpu_others, csw,
                time, threads, ports, mregion, mem, rprvt, purg, vsize, vprvt,
                kprvt, kshrd, pgrp, ppid, state, uid, wq, faults, cow, user,
                msgsent, msgrecv, sysbsd, sysmach, pageins, boosts, instrs, cycles
        [-R | -r]
        [-S]
        [-s <delay>]
        [-n <nprocs>]
        [-stats <key(s)>]
        [-pid <processid>]
        [-user <username>]
        [-U <username>]
        [-u]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值