What's so great about Unix?

What's so great about Unix can be described in one word: power. Unix gives you power to do your work more efficiently and more quickly. You may have to pay an up-front cost of learning, but the curve isn't that steep. The secret to that power is the Unix command line, and that power is driven simply by words.

When I started using IBM PCs, Microsoft Windows did not exist. We did all our work with text-based displays on green monitors using DOS. There was no point-and-click, no drag-and-drop. If you wanted to move files, you typed a command. If you wanted to delete or rename files, you typed a command. If you wanted to run a program, you typed a command.

Many consider that type of command line interface to be primitive today, even quaint. You may see it that way yourself. Yet if you used DOS for many years before making the transition to Windows, like I did, you probably did the same thing I did on your first day with Windows: you looked for the command line. You realized that the Windows icon-based interface just didn't give you the same power or control you had with the command line. With DOS you could work much more efficiently simply by typing a few words, compared to the mousing Windows requires.

The DOS command line gave you power (and still does, if you use it). The Unix command line gives you many times that power. Unix has hundreds of commands and tools for working with words--and as a theologian, your focus is working with words. A common complaint is that Unix isn't user-friendly. A common retort is that Unix is user friendly--it's just picky about who its friends are. Unix is strongly based in text, in words. It is friendly to those who are not afraid to use words, to learn and type commands. Check out the interesting article, The Elements of Style: UNIX as Literature for more. I'll wait here while you do.

An example of Unix power

Unix gives you power you can't find in Windows--not easily, anyway. An example: when planning worship services, I didn't want to repeat hymns too frequently but instead choose a wide variety. For a while I'd look through my previous weeks' worship plans when choosing hymns, making certain that I hadn't chosen particular hymns too recently. It didn't take long for that process to consume a lot of my time.

Our denomination published some hymnal software which would play hymns and worship music, and would also keep track of the dates each hymn was used in worship. That last feature was just what I needed. Unfortunately for me, the software cost more than I could afford and also ran only on Windows, which I didn't have.

But I did have Linux, and that gave me the tools I needed. At first I thought about writing a hymn usage database program in C. It would mean brushing up on my C programming, planning out a user interface and data storage format, and writing and debugging the program. It would easily be a several hundred or thousand line program and the project would take more time than I could spare.

Unix often gives you several ways to do a job, though. After some thought I realized that what I really wanted to do was store my hymn information as text in a format like this:

date hymn# hymn# hymn# hymn#

and search for a particular hymn number. I knew that the awk language would do the job, and I had always wanted to learn awk. However, after a few hours of trying to decipher someone else's idea of an awk program, I saw that awk was a larger project than I wanted too.

Then I realized that the solution was so simple I had completely missed it. Unix has a standard utility called grep, which searches a file for an expression you specify and shows you the lines which match the expression. That was all I wanted my hymn program to do, and so I ended up writing a Unix script (like a DOS batch file) called hymn. It contained one line:

grep -w "$1" hymns.96

When planning worship services, I'd simply type (at the Linux command line) hymn 252, for example, and grep would look through my file called hymns.96 for all lines containing the number 252 and show them to me. I'd gone from a (hypothetical) full C application of hundreds of lines (and many hours) to a one-line program. That's the sort of power Unix gives you. It's the power of being able to tell your computer exactly what you want it to do, and get the results you need.

Back to main page