![컬러캣(ccat)을 적은 양으로 파이프할 수 있나요? [복사]](https://linux55.com/image/168584/%EC%BB%AC%EB%9F%AC%EC%BA%A3(ccat)%EC%9D%84%20%EC%A0%81%EC%9D%80%20%EC%96%91%EC%9C%BC%EB%A1%9C%20%ED%8C%8C%EC%9D%B4%ED%94%84%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%82%98%EC%9A%94%3F%20%5B%EB%B3%B5%EC%82%AC%5D.png)
내가 찾은ccat
자주 사용하는 명령어에 색상을 지정하는 명령어입니다 cat
. less
파이프를 통해 색상을 유지하는 방법이 있나요 ?
이렇게 하면 ccat config.json | less
색이 안 나올 것 같아요!
미리 감사드립니다.
답변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