NAME
SYNOPSIS
/etc/pscolor
$HOME/.pscolor
DESCRIPTION
The pscolor file tells pscol(1) to setup the colorization variables in your shell.
FORMAT
Each line is made up of:
type,date,color
The config file looks like this:
[COMMON]
type,date,color
...
type,date,color
[PS]
type,date,color
...
type,date,color
[TOP]
type,date,color
...
type,date,color
Anything that follows a # sign and blank lines will be ignored. If you want to include all of PS in TOP, put =PS under [TOP]. Same is true for PS to include TOP. [COMMON] is just that but you have to include it using =COMMON (placement usually matters in ps/top). [COMMON] may not include PS or TOP. If both PS and TOP are not present, but [COMMON] is, [COMMON] will become both. You can also put #!/usr/bin/pscol at the beginning to use the color file as a script.
Confusing? See examples.
type data description
1/unk not yet implemented
2/user uid/name/+ any process belonging to user with uid/name s
3/state char state any process with state s
4/mem % mem any process using more than s% phys. memory
5/cpu % cpu same as above, but cpu usage
6/size size in K any process alrger than size k
7/tty tty(char 4) any process having controlling terminal s
- unk
-
Unknown. This is part of proc ps that wasn't defined.
- user
-
Shows processes owned by user. user may be a colon seperated list of usernames. If user is a user name, that user name is converted to a number. If user is a +, it will be replaced by the uid of the person who ran pscol.
- state
-
Shows processes that have state s. State can be one of:
< Niced process (level < 0, usually privilaged)
> Process exceeded soft limits?
D uniteruptible sleeping (probably Dead)
N Niced process (level > 0)
R running processes (You really should go catch it!)
S sleeping processes
T suspended processes
W Swapped out (usually following an S)
Z zombied processes
- mem
-
Percentage of memory used.
- cpu
-
Percentage of cpu used.
- size
-
Any process using more then sizek of ram
- tty
-
Any process running on tty without /dev and tty.
Examples: 1 p0 C2 S4
NOTE this will segfault ps(1) 1.09. I do not know about other versions.
Colorization can be done 2 ways.
1: use ANSI codes (leaving off ESC[ and the trailing m)
2: use words.
ANSI CODES
- 1
-
Set high intensity attribute (BOLD)
- 4
-
Set underscoring attribute (not all terminals)
- 5
-
Set blinking attribute
- 7
-
Set reverse video attribute
- 8
-
Set concealed attribute (useless)
- FG BG
- 30 40
-
black
- 31 41
-
red
- 32 42
-
green
- 33 43
-
yellow (low intensity yields brown on some terminals)
- 34 44
-
blue
- 35 45
-
magenta
- 36 46
-
cyan
- 37 47
-
white
If you'd rather not look at the above EVERYTIME you want to add another color or to even change a color. You may want to use the word format:
[blink] [bright] foreground color [on background color]
- blink
-
Sets blinking attribute
- bright
-
Sets the hight intensity attribute (BOLD)
- black
-
Set color to black (default for background)
- blue
-
Set color to blue
- green
-
Set color to green
- cyan
-
Set color to cyan
- red
-
Set color to red
- magenta
-
Set color to magenta
- yellow
-
Set color to yellow (low intensity yields brown on some terminals)
- white
-
Set color to white (default for the foreground)
Each of these can be shortened to only 3 characters. (Actually, pscol only reads the first 3 letters of the color, so if you put 'blueiscool' for the color, pscol will read it as 'blu')
EXAMPLES
See pscolor for an example. See pscolor.1 and pscolor.2 for more examples
AUTHOR
William Thompson, <[email protected]>, <[email protected]>.
SEE ALSO
ps(1), ps_color(7), pscol(1), top(1)