TOP 使用技巧:讓你的top有生有色
TOP 使用技巧:讓你的top有生有色
看到top輸出時的黑白界面是不是感覺有點感官疲勞啊
下面就讓我們預定製咱喜歡的顏色,讓top容光煥發:lol
首先運行Top命令
shift + z
會看到如下界面:
Help for color mapping - procps version 3.2.6
current window: 1:Def
color - 04:25:44 up 8 days, 50 min, 7 users, load average:
Tasks: 64 total, 2 running, 62 sleeping, 0 stopped,
Cpu(s): 76.5% user, 11.2% system, 0.0% nice, 12.3% idle
Nasty Message! -or- Input Prompt
PID TTY PR NI %CPU TIME+ VIRT SWAP STA Command
17284 pts/2 8 0 0.0 0:00.75 1380 0 S /bin/bash
8601 pts/1 7 -10 0.4 0:00.03 916 0 R < color -b
11005 ? 9 0 0.0 0:02.50 2852 1008 S amor -ses
available toggles: B =disable bold globally (Off),
z =color/mono (On), b =tasks "bold"/reverse (On)
Select target as upper case letter:
S = Summary Data, M = Messages/Prompts,
H = Column Heads, T = Task Information
Select color as number:
0 = black, 1 = red, 2 = green, 3 = yellow,
4 = blue, 5 = magenta, 6 = cyan, 7 = white
Selected: target T ; color 2
press 'q' to abort changes to window '1:Def'
press 'a' or 'w' to commit & change another,
to commit and end
這裡我們就可以預定義top窗口的顏色了
各命令參數解釋
Select color as number: 選擇預定義的顏色
0 = black, 1 = red, 2 = green, 3 = yellow,
4 = blue, 5 = magenta, 6 = cyan, 7 = white
S:預定義以下兩欄界面顏色
Tasks: 64 total, 2 running, 62 sleeping, 0 stopped,
Cpu(s): 76.5% user, 11.2% system, 0.0% nice, 12.3% idle
M:預定義以下界面顏色
Nasty Message! -or- Input Prompt
H:預定義以下界面顏色
PID TTY PR NI %CPU TIME+ VIRT SWAP STA Command
T:預定義以下界面顏色
17284 pts/2 8 0 0.0 0:00.75 1380 0 S /bin/bash
8601 pts/1 7 -10 0.4 0:00.03 916 0 R < color -b
11005 ? 9 0 0.0 0:02.50 2852 1008 S amor -ses
Enter回到top界面 我們會發現顏色變成彩色了 :$
如果讓設置下次運行top繼續生效 W 保存
退出再Top一下 看看 :funk:
嘿嘿 今天你TOP了嗎(⊙_⊙)?
當然TOP還有N多好玩的東東 有興趣的慢慢體會:sleepy: 《解決方案》
No colors to map!