When I run a program (for example grep
or ls
) without a pager, its output is colored. However when I run it piping its output to less
, no colors are shown.
For example, this command outputs colored output:
grep -r something
but this doesn't:
grep -r something | less
Why? How can I see colors through less
?