← 返回命令列表

Linux command

ccat 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Display file with syntax highlighting

ccat [file.py]

Display multiple files

ccat [file1.go] [file2.js]

Output as HTML

ccat --html [file.rb]

Dark background colors

ccat --bg=dark [file.c]

Show color palette

ccat --palette

说明

ccat is a drop-in replacement for cat that adds syntax highlighting to file contents displayed in the terminal. It automatically detects the programming language from the file extension and applies color coding to keywords, strings, comments, and other syntax elements. The tool supports a wide range of languages including JavaScript, Python, Go, Ruby, C, C++, Java, and JSON. It ships as a single binary with no external dependencies, providing native execution speed. Output can be rendered for light or dark terminal backgrounds, and HTML output is available for embedding highlighted code in web pages.

参数

--html
Output as HTML
--bg=_color_
Background color: light, dark
-G _key=color_
Set custom color codes
--palette
Display color palette
-C, --color=_mode_
Color mode: always, never, auto

FAQ

What is the ccat command used for?

ccat is a drop-in replacement for cat that adds syntax highlighting to file contents displayed in the terminal. It automatically detects the programming language from the file extension and applies color coding to keywords, strings, comments, and other syntax elements. The tool supports a wide range of languages including JavaScript, Python, Go, Ruby, C, C++, Java, and JSON. It ships as a single binary with no external dependencies, providing native execution speed. Output can be rendered for light or dark terminal backgrounds, and HTML output is available for embedding highlighted code in web pages.

How do I run a basic ccat example?

Run `ccat [file.py]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --html do in ccat?

Output as HTML