LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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.

INSTALL

sudo apt install ccrypt
copy
brew install ccrypt
copy
nix profile install nixpkgs#ccrypt
copy

CAVEATS

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

SEE ALSO

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

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid