When I have dircolors defined life is full of… color.
When I pipe ls
through less
to scroll around I lose the colors.
Any suggestions?
bashlesslinuxlsshell
When I have dircolors defined life is full of… color.
When I pipe ls
through less
to scroll around I lose the colors.
Any suggestions?
Best Answer
Most likely your
ls
is aliased tols --color=auto
, which tellsls
to only use colors when its output is a tty. If you dols --color
(which is morally equivalent tols --color=always
), that will force it to turn on colors.You could also change your alias to do that, but I wouldn't really call that a good idea. Better to make a different alias with
--color
.less
needs-R
too, which causes it to output the raw control characters.