top - Linux tools 1 of n

(1) The command line
top -hv|-bcHisS -d delay -n limit -u|U user -p pid -w [cols]

# dump top to a text file (-b batch mode)
top -b -n 1 > top.txt 

# use command line instead of command name (-c command line switch)
top -bc -n 1 > top.txt 

Process Status
               'D' = uninterruptible sleep
               'R' = running
               'S' = sleeping
               'T' = traced or stopped
               'Z' = zombie

(2) Useful commands
0) Overall

           Global-defaults
              'A' - Alt display      Off (full-screen)
            * 'd' - Delay time       3.0 seconds
            * 'H' - Threads mode     Off (summarize as tasks)
              'I' - Irix mode        On  (no, 'solaris' smp)
            * 'p' - PID monitoring   Off (show all processes)
            * 's' - Secure mode      Off (unsecured)
              'B' - Bold enable      On  (yes, bold globally)

           Summary-Area-defaults
              'l' - Load Avg/Uptime  On  (thus program name)
              't' - Task/Cpu states  On  (1+1 lines, see '1')
              'm' - Mem/Swap usage   On  (2 lines worth)
              '1' - Single Cpu       On  (thus 1 line if smp)

           Task-Area-defaults
              'b' - Bold hilite      On  (not 'reverse')
            * 'c' - Command line     Off (name, not cmdline)
            * 'i' - Idle tasks       On  (show all tasks)
              'R' - Reverse sort     On  (pids high-to-low)
            * 'S' - Cumulative time  Off (no, dead children)
            * 'u' - User filter      Off (show euid only)
            * 'U' - User filter      Off (show any uid)
              'x' - Column hilite    Off (no, sort field)
              'y' - Row hilite       On  (yes, running tasks)
              'z' - color/mono       Off (no, colors)

1)  scroll the window

              key      equivalents

              Up       alt + \   or   alt + k
              Down  alt + /   or   alt + j
              Left      alt + <   or   alt + h
              Right   alt + >   or   alt + l  (lower case L)
              PgUp   alt + Up
              PgDn   alt + Down
              Home  alt + Left
              End      alt + Right

2) Change the "refresh" interval
"d" + enter and then "interval"


3) Column sorting
"R" reverse the sorting

        command   sorted-field                  supported
              A         start time (non-display)      No
              M         %MEM                          Yes
              N         PID                           Yes
              P         %CPU                          Yes
              T         TIME+                         Yes

4) Process tree (forest mode)
"V" + enter, press "V" again to exit the mode

5) Filter out idle process
"i" + enter, press "i" again to exit the mode

5) Filter the "owner" process
"u" + "owner", press "U" to exit the mode

6) Searching
"L" + "text needed to search"  # case senstive
"&"  # next occurrence.

7) Show each CPU usage for SMP
"1" + enter, precess "1" again to exit the mode

8) The interactive commands cheatsheet
"h" + enter

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值