Kjetil Kr Solberg logo

Kjetil Kristoffer Solberg

Software, Firmware & Hardware, Author and Entrepreneur



Linux: ccat

The ccat command I created for Linux - written in Pascal - types files to screen like the cat command does, except it runs the files through a color filter. An example of the output for a small XML file and a small Pascal file is shown below.




In order to try out ccat you first need to do a:
git clone https://github.com/sith-ikjetil/ccat.git

Then you need to have the free pascal compiler installed in order to compile the application. You install it on Ubuntu like this:
sudo apt install fpc

Then you navigate to the ./ccat/src directory and run the build.sh build script. After the build is finished you have a ccat executable and you can put it in a bin folder that is part of your path. For example /usr/bin or ~/bin if you have your own bin directory in your home directory.

Next you must create a directory in your home folder called .ccat (~/.ccat). Copy all .ccrc files from source directory ./ccat/ccrc/ to this directory.

This is all you need to have files colorized with output. There are now a small number of supported file types with their own color configuration. These are:
  • .asm
  • .ino
  • .awk
  • .c|.cpp|.h
  • .cs
  • .f90|.f95|.f03|.f|.ff|.for
  • .hs
  • .html
  • .js
  • .json
  • .pas
  • .pl
  • .py
  • .rb
  • .rs
  • .sh
  • .sql
  • .swift
  • .txt
  • .xml
If a file does not have a corresponding ccrc file it defaults to the .txt color filter file.

You can override the ccat command with --syntax=<first name of ccrc filename> if you need to specify the syntax it should use.

For easier install of the application. Not caring about source code or building it yourself. Please feel free to install the following package.
NB! Now with man pages:
man ccat
Operating System Architecture Version Release Date File Size SHA256 Download
Ubuntu amd64 1.2.1 2026-09-05 279.6kB 406a933ce3... Download (.deb)
Fedora x86_64 1.2.1 2026-09-05 288.7kB 9054ddde18... Download (.rpm)
openSUSE x86_64 1.2.1 2026-09-05 288.7kB 9054ddde18... Download (.rpm)
macOS 27 arm64 1.2.1 2026-10-11 534kB 11bf9fcaa5 ... Download (.pkg)

Install on native Ubuntu
# Install ccat on Ubuntu
$ wget https://www.ikjetil.no/download/misc/ccat_1.2.1_amd64.deb
$ sudo dpkg -i ./ccat_1.2.1_amd64.deb
Install on native Fedora
# Install ccat on Fedora
$ wget https://www.ikjetil.no/download/misc/ccat-1.2.1-1.fc44.x86_64.rpm
$ sudo dnf install ./ccat-1.2.1-1.fc44.x86_64.rpm
Install on native openSUSE
# Install ccat on openSUSE
$ wget https://www.ikjetil.no/download/misc/ccat-1.2.1-1.x86_64.rpm
$ sudo zypper install ./ccat-1.2.1-1.x86_64.rpm
# If you get 'Package header is not signed!', press i for the option input.