LinuxCommandLibrary

ccat

colorizing cat with syntax highlighting

TLDR

Display file with syntax highlighting

$ ccat [file.py]
copy
Display multiple files
$ ccat [file1.go] [file2.js]
copy
Output as HTML
$ ccat --html [file.rb]
copy
Dark background colors
$ ccat --bg=dark [file.c]
copy
Show color palette
$ ccat --palette
copy

SYNOPSIS

ccat [options] file...

DESCRIPTION

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.

PARAMETERS

--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

SUPPORTED LANGUAGES

- JavaScript / TypeScript
- Python
- Go
- Ruby
- C / C++
- Java
- JSON
- And more via Pygments

ALIASING

Replace cat with ccat:

$ alias cat='ccat'
copy
Add to ~/.bashrc for permanent use.

CAVEATS

Written in Go (owenthereal version) or Python (welbornprod version). Requires terminal with color support.

SEE ALSO

cat(1), bat(1), highlight(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community