I find out ccat which is a command to colorize the usual cat command. Is there a way to pipe this in less mantaining colors?
If I do ccat config.json | less there's no color!
Thanks in advance.
I find out ccat which is a command to colorize the usual cat command. Is there a way to pipe this in less mantaining colors?
If I do ccat config.json | less there's no color!
Thanks in advance.
As cat --help explain, I have to use color option:
-C, --color="auto": colorize the output; value can be "never", "always" or "auto" Using color is auto both by default and with --color=auto. With --color=auto, ccat emits color codes only when standard output is connected to a terminal. So to have less colorized I need to do:
ccat --color="always" config.json | less
less -Rwill show colorized outputless -Ras you can see with this asciinema: asciinema.org/a/Hw1n48N8VbJ0ak6mdrYkS5MvIccatto send colorised output toless(which it probably doesn't, like most decent tools when output is not a terminal). Probably with--color=alwaysif it follows GNU conventionsccat!