首先运行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, <Enter> 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: