Show Colors in less
This page answers questions like these:
How to get less to show colors?
How to get less to show colors that are piped into it?
How to get less to show colors from ls ?
How to get less to show colors from grep ?
How to get less to preserve colors?
Related Links:
Different Colors for Control Characters and Pattern Matches in less
Make less Keep Reading a Growing File
Ungetcc Overflow Error Coming From less
Show Colors in grep
Show ls File Sizes with Commas
CPUs at Top of top
Get less to Show Colors:
less -R
OR
LESS="-R" less
Examples:
ls --color | less -R
ls --color | LESS="-R" less
export LESS="-R"; ls --color | less
grep --color PATTERN FILE | less -R
grep --color PATTERN FILE | LESS="-R" less
export LESS="-R"; grep --color PATTERN FILE | less
The -R option to less tells it to show the colors formed by ANSI color sequences piped into it, or read in via files.
The most common use of this is to see the colors output by commands like ls , grep , and egrep .
The LESS environment variable allows you to specify options that apply to all less invocations.
Related Links:
Different Colors for Control Characters and Pattern Matches in less
Make less Keep Reading a Growing File
Ungetcc Overflow Error Coming From less
Show Colors in grep
Show ls File Sizes with Commas
CPUs at Top of top
Home > Linux / Unix > Show Colors in less
Tags: less colors, less colours, less with colors, less with colours, less show color, less show colours, show colors in less, show colours in less, less command, linux, unix, solaris, bsd, aix
Copyright © HelpDoco.com
less-colors.txt
Linux-Unix/show-colors-in-less.htm
1