Using ls
or many other commands, we can get colorful results like this:
But if those results are too long and after we pipe those results to less
, the color is disappeared.
This is the result of ls -l | less
:
- Why the color is disappeared.
- How to make the result of
ls | less
colorful?
From the man page for
ls
:Note that
always
is the default.From the man page for
less
:So overall, you need this: