Show Colors in grep
This page answers questions like these:
- How to get grep to show colors?
- How to highlight the pattern match in grep output?
Related Links:
Show Colors in less
Different Colors for Control Characters and Pattern Matches in less
Show ls File Sizes with Commas
CPUs at Top of top
Get grep to Show Colors:
grep --color
OR
GREP_OPTIONS="--color" grep
Examples:
grep --color PATTERN FILE
GREP_OPTIONS="--color" grep PATTERN FILE
export GREP_OPTIONS="--color"; grep PATTERN FILE
- The --color option to grep tells it to show pattern matches in color.
- The GREP_OPTIONS environment variable allows you to specify options that apply to all grep invocations.
Related Links:
Show Colors in less
Different Colors for Control Characters and Pattern Matches in less
Show ls File Sizes with Commas
CPUs at Top of top
Home > Linux / Unix > Show Colors in grep
Tags: grep colors, grep colours, grep with colors, grep with colours, grep show color, grep show colours, show colors in grep, show colours in grep, grep command, linux, unix, solaris, bsd, aix
Copyright © HelpDoco.com
grep-colors.txt
Linux-Unix/show-colors-in-grep.htm
1