Reading and analyzing the log files in white text on a black background can be difficult and take a lot of time. Colorized log files is one of the solutions. The ccze is a command line tool that allows to print the colorized log files to make them more readable.
This tutorial shows how to install ccze on Ubuntu 20.04.
Make sure the package lists are up-to-date:
sudo apt update
Run the following command to install ccze:
sudo apt install -y ccze
Once installation is completed, we can check ccze version:
cat or other command can be used to read the log file and then colorize the output by piping to
ccze command. The
-A option is used to generate ANSI output by inserting color codes in the log.
cat /var/log/dpkg.log | ccze -A
An example of output:
If decided to completely remove the ccze, run the following command:
sudo apt purge --autoremove -y ccze