答案1
正如所cat --help
解释的,我必须使用color
选项:
-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.
所以要less
着色我需要这样做:
ccat --color="always" config.json | less