Open In App

Ccat – Colorize Cat Command Output command in Linux with Examples

Last Updated : 23 Sep, 2021
Like Article

ccat is a command-line tool for Linux and OSX, which is similar to the cat command in Linux. But the difference between cat and ccat is that the ccat shows the content of the file with the syntax highlighted. Currently, ccat supports the following programming languages.

  • JavaScript
  • Java
  • Ruby
  • Python
  • Go
  • C
  • JSON

Installation of Ccat 

First, we are going to see how to install the ccat on OSX then Linux.


For OSX to install ccat you can install the ccat with the help of the brew command:

$ brew install ccat

For Linux

To install the ccat on the Linux systems first we need to install all prerequisites required to install ccat. The prerequisites are as follows:

Before moving further, make sure that you have installed the required prerequisites. Then use the following command to install the ccat on your Linux system:

$  go install

Now let’s see how to use the ccat command in Linux.

Using ccat command

The syntax ccat is very simple. To display the content of single file syntax is as follows:

$ ccat FILE_NAME


$ ccat index.html

Ccat – Colorize Cat Command Output

To display the content of a file from another directory, ccat has the following syntax:



$ ccat /var/db/Makefile

Ccat – Colorize Cat Command Output

To display the content of multiple files, mention the file names after the ccat command:



$ cat index.html main.cpp

Ccat – Colorize Cat Command Output

Set Dark Background

To set dark background, use the –bg option with the ccat command:

$ ccat --bg=dark FILENAME


$ ccat --bg=dark index.html

We can also set the color codes to the syntax of the output of ccat. Here is one example:

To show the color palette of ccat uses the following command:

$ ccat --palette

ccat also provides another best feature is that it can show the output in the HTML form also. To show the output in the HTML format, use the –html at the end pf ccat command

$ ccat FILENAME --html


$ ccat main.cpp --html

If you open the output in the browser, then you will see the output as follows:


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads