The CLI has become an essential tool for most all developers as of late. From debugging complex code issues to simply managing a source-controlled project with Git, few people can escape the world that is the black-screen with green text.
As foreboding or intimidating as the black screen may be, there are ways to make your life easier and better when using it. Below are a couple from my personal archives that I use daily.
BAT – The full-featured CAT replacement
One of the things that I find myself doing regularly is looking at text files that have been generated from another service to confirm validity or simply grab a tidbit of information from them. In those cases, I generally use the
CAT command. It simply takes the content of the given file and spits it into the command prompt. It’s a pretty bland command, no formatting, no pretty colors, just simply text. Most IDE’s on the other hand give us both. In steps
If you have ever worked on the network layer of setting up a server or dealing with network related issues (is my network down?), then you have likely used “ping”. It’s a very bland, text only affair that tells you just a little information.
Now in the days of a pretty, multi-colored, command line session, PrettyPing steps in to make things that much nicer!
Searching through lists of things in the command line has never been particularly easy. You could usually find a way to sort through what you needed, but adding filters or searching on that data was never great. Most specifically, looking your console history
history was not a trivial matter.
Enter FZF: You can add it to your directory lookups, file finds or console history either through an alias or by piping data to it (i.e.
history | fzf).
Git Diff’s tend to be very anemic and bland. While it is nice for them to function properly, if you can’t understand what they are showing or have a hard time reading it, they quickly become useless. Make them great again with Diff-so-Fancy.
It is sometimes useful for computer users to see what your computer is doing and how the processor and memory are being consumed. While there are some OS based built-in tools, most linux boxes don’t have this. That however doesn’t mean that it’s linux only, as I have it running on my mac as well.
fd – find files
Finding files from the command line has always been difficult. From figuring out which command to use to how to format the parameters, it’s always been very tough to find what you were looking for. FD fixes all of that.
ncdu – disk usage
Current computers suffer from the plague that is tiny hard-drives. Modern SSD’s, which growing larger in size and smaller in cost are still smaller than the spinning platters of a few years back. One of my favorite mac apps for helping fix this is Daisy Disk, a very attractive disk space visualizer. The closest thing that we have on linux is ncdu.
Just for Fun
cowsay / ponysay
Ever want to make the cow say things?
apt install cowsay cowsay "Your message here"
brew install cowsay cowsay "Your message here"
Some neat text effects for messages in the command line. Works great for MOTD’s on servers.
apt install figlet figlet "Your message here"
brew install figlet figlet "Your message here"
And just because command-lines aren’t the same until there’s color, there’s lolcat!
apt install lolcat lolcat "Your message here" figlet "My Cool Message" | lolcat
brew install lolcat lolcat "Your message here" cowsay "My Cool Message" | lolcat