cli Kung-fu

by debianjoe

assembler

“I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times.” – Bruce Lee

Every month or so, I’ll run across a need that I end up discovering is best served by some very simple tool that has been sitting around on my system without me truly understanding how to use it.  GNUcoreutils on a Linux system are probably the most common of these, and while I appreciate the learning process, this normally starts me down the long track of “So, just how much do I NOT know?”  The answer is that the more I learn, the more I realize that I fail to fully understand.

That bit of humble-pie aside, I am at least made more aware of what all CAN be done without the need for many additional tools to a native cli/tui environment.  This leads me to think about how much could be accomplished if I simply knew all of the tools and options for the most basic tools in the GNUcoreutils toolkit.  Really, the entirety of the Unix way is found not in the use of complex tools, but in mastering the simple ones and learning to chain them together in an elegant arrangement.  The beauty of any unix or unix-like system is in piping and shell, the power to control stdin/out/err and bend them to our wills.  So often we simply are out to reinvent the wheel simply because we failed to see that there was already a cart built that could fill our needs if only we knew how to make it work for us.

So, dear cli kung-fu masters in training, allow me to pose a challenge for those of you who wish to reach enlightenment on the path to the Unix-way.  Go to http://www.gnu.org/software/coreutils/manual/coreutils.html, and pick one tool.  Learn every single option and switch available for it, and play with options using it until you truly understand the depth of what is being offered.  I can almost assure you that you will learn something that you didn’t know previously, even if you’ve used the tool before.  I personally have found that with the use of pipes and tricks that I already know with stream editing, that I come up with new and different ways to do things.  These aren’t always “better” than how I might have done them otherwise, but nonetheless, I find my own knowledge increases with every new trick I learn.  While whatever I’m doing may not be the perfect scenario to need the new method, you can be assured that it will probably be exactly the method that you’ll need in some situation.

The master of cli is not the man who knows how to use 10,000 programs, but who can handle 10,000 cases with a single tool.

Advertisements