Grep highlight settings
The grep highlight function is similar to the hlsearch function in vim. It highlights matching items and is easy to locate,
Here, a grep parameter-color is used. color has three values for selection: never, always, and auto.
The difference between always and auto is that always will add a color tag to the matching field in all circumstances. when it passes through the pipeline or redirection, there will be more control characters and the result will become
Export ^ [[1; 32m ^ [[KGREP ^ [m ^ [[K_OPTIONS = '-color = always'
Export ^ [[1; 32m ^ [[KGREP ^ [m ^ [[K_COLOR = '1; 32 ′
Auto adds color only when it is output to the terminal.
You can add
Export GREP_OPTIONS = '-color = auto'
To achieve highlight matching, the specific color, you can use
Export GREP_COLOR = 'a; B '# The default value is 1; 31, which is highlighted in red.
, Where:
A]
0 close all properties
1. Set High Brightness
4 underline
5 flashes
7. Reverse display
8. Hide
B: [30-37 or 40-47]
30 black
31 red
32 green
33 yellow
34 blue
35 purple
36 cyan
37 white
30-37 set the foreground color
40-47 set the background color