I sometimes find myself choosing between multiple commands to see the content of a text file:
As a side note, where does the name cat come from? Other Unix commands usually have a suggestive name, even if abbreviated: ls = list, cp = copy, mv = move, etc. Cat comes from ‘conCATenate’ because it can be used to concatenate files, using the shell redirection mechanism:
cat file1 file2 [...] > file-result
All those are fine and dandy and more than 30 years old (or 50?). So, enter bat, a command thought to replace cat, with some improvements:
How to install it? Well, fortunately there are packages so a simple apt install bat or brew install bat will quickly do it. On Debian, the command is named batcat.
This is how it looks:
In the end, if you like it, find out more on the official Github page at https://github.com/sharkdp/bat .
Viorel Anghel has 20+ years of experience as an IT Professional, taking on various roles, such as Systems Architect, Sysadmin, Network Engineer, SRE, DevOps, and Tech Lead. He has a background in Unix/Linux systems administration, high availability, scalability, change, and config management. Also, Viorel is a RedHat Certified Engineer and AWS Certified Solutions Architect, working with Docker, Kubernetes, Xen, AWS, GCP, Cassandra, Kafka, and many other technologies. He is the Head of Cloud and Infrastructure at eSolutions.