Add some FUN to your CLI with GRC

Admittedly, I am way too excited about stumbling upon this tool while researching another project. As I’ve gotten along in may career, I find myself at the CLI less and less. So, when I do have the opportunity to roll up my sleeves and get access to the CLI, I like to have some fun at the same time ;)

Objective

Install and configure the GRC (Generic Colouriser) to add a little color to existing CLI commands.

Installation

GRC is available via GitHub as well as packaged for many LINUX distributions. In the case of Ubuntu or Debian and derivatives, installing is as simple as using in the APT package manager:

# apt-get install grc

GRC is also available for Mac OS via Homebrew:

% brew install grc

Usage

GRC consists of 2 main tools:

  • grcat — the main command
  • grc — acts as frontend for grcat

The main command is grcat, which acts as a filter, i.e. taking standard input, colorizing it, and writing to standard output. grc will execute the specified command with optional parameters piping its stdout into grcat.

By default, grc will be installed with a number of configurations for many popular commands. While the number of configurations will vary amongst packages for different distributions, the following configurations are delivered in the default installation via Homebrew for Mac OS:

ant
blkid
configure
cvs
df
diff
dig
dnf
docker-machinels
dockerimages
dockerinfo
dockernetwork
dockerps
dockersearch
dockerversion
du
env
fdisk
findmnt
free
gcc
getfacl
getsebool
go-test
id
ifconfig
iostat_sar
ip
ipaddr
ipneighbor
iproute
iptables
irclog
iwconfig
kubectl
last
ldap
log
lolcat
ls
lsattr
lsblk
lsmod
lsof
lspci
mount
mtr
mvn
netstat
nmap
ntpdate
ping
ps
semanageboolean
semanagefcontext
semanageuser
sensors
showmount
sockstat
ss
stat
sysctl
systemctl
tcpdump
traceroute
tune2fs
ulimit
uptime
vmstat
wdiff
whois

Basic

You can get started immediately by prepending any of the above commands with grc. For example:

% grc traceroute -n google.com

Advanced

Beyond manually prepending the commands listed above with grc, you can additionally configure your shell with some of the pre-delivered env scripts. The grc README file explains how to do this in detail — including how to add custom configurations for additional commands.

Conclusion

The GRC command is a fun way to add some color to existing CLI tools. Enjoy!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How To Resolve Public Cloud FQDN Locally From Windows 10

Semantic Web History & Tools to use, to “Naturalise the Web”

3rd Week of the 2nd phase in EncorAcademy

Monthly Report — Feb 2021

Test Automation Strategy for REST APIs

How to Profile a Python Program

Efficiency

Making your own Monad

The Art of the Start with SQL

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jake Holmquist

Jake Holmquist

More from Medium

What is Unix? Its History and Features

Double click to execute a shell script in Mac OS Monterey — 3 steps

libgpiod API usage (Linux shared libraries) On Eclipse- Solving Problem with libgpiod — undefined…

Finally finished a weekend project