Unix Koans

I was quite impressed by Eric S. Raymond’s Unix Koans, because they describe the beauty of Unix so strikingly. Then I discovered the teachings of Zen, actually because of his texts. Again impressed by all that, I decided to write my own Unix Koans — not all by myself, but heavily inspired by Mumon’s Gateless Gate.

The first four have been reworked by Eric S. Raymond; thanks for his improvements!

Master Foo and the Old Hand

A Unix programmer, hearing of Master Foo’s wisdom, came to him for guidance. Approaching the Master, he bowed three times and said:

“Master Foo, I am gravely troubled. In my youth, those who followed the Great Way of Unix used software that was simple and unaffected, like ed and mailx. Today, they use vim and mutt. Tomorrow I fear they will use KMail and Evolution, and Unix will have become like Windows — bloated and covered over with GUIs.”

Master Foo said: “But what software do you use when you want to draw a poster?”

The programmer replied: “I...have never done that. But I am sure that I could use LaTeX or pic to accomplish it without GUIs, in the proper Unix way.”

Master Foo then said: “Which one will reach the other side of the river: The one who dreams of a raft, or the one that hitchhikes to the next bridge?”

Upon hearing this, the programmer was enlightened.

Master Foo and the MCSE

Once, a famous Windows system administrator came to Master Foo and asked him for instruction: “I have heard that you are a powerful Unix wizard. Let us trade secrets, that we may both gain thereby.”

Master Foo said: “It is good that you seek wisdom. But in the Way of Unix, there are no secrets.”

The administrator looked puzzled at this. “But it is said that you are a great Unix guru who knows all the innermost secrets. As do I in Windows; I am an MCSE, and I have many other certifications of knowledge not common in the world. I know even the most obscure registry entries by heart. I can tell you everything about the Windows API, yea, even secrets those of Redmond have half-forgotten. What is the arcane lore that gives you your power?”

Master Foo said: “I have none. Nothing is hidden, nothing is revealed.”

Growing angry, the administrator said: “Very well, if you hold no secrets, then tell me: what do I have to know to become as powerful in the Unix way as you?”

Master Foo said: “A man who mistakes secrets for knowledge is like a man who, seeking light, hugs a candle so closely that he smothers it and burns his hand.”

Upon hearing this, the administrator was enlightened.

Master Foo and the Shell Tools

A Unix novice came to Master Foo and said: “I am confused. Isn’t it the Unix way that every program should concentrate on one thing and do it well?”

Master Foo nodded.

The novice continued: “Isn’t it also the Unix way that the wheel should not be reinvented?”

Master Foo nodded again.

“Why, then, are there several tools with similar capabilities in text processing: sed, awk and perl? With which one can I best practice the Unix way?”

Master Foo replied: “If you have a text file, what tool would you use to produce a copy with a few words in it replaced by strings of your choosing?”

The novice frowned and said: “Perl’s regexps would be excessive for so simple a task. I do not know awk, and I have been writing sed scripts in the last few weeks. As I have some experience with sed, at the moment I would prefer it. But if the job only needs to be done once rather than repeatedly, a text editor would suffice.”

Master Foo nodded and replied: “When you are hungry, eat; when you are thirsty, drink; when you are are tired, sleep.”

Upon hearing this, the novice was enlightened.

Master Foo Discourses on Returning to Windows

A student said: “We have learned that Unix is not just an operating system, but also a style of approaching problems.”

Master Foo nodded.

The student continued: “Then, the Great Way of Unix can be applied on other operating systems?”

Master Foo sat silent for a moment, then said: “In every operating system there is a path to the Great Way, if only we can find it.”

The student continued: “What, then, of Windows? It is preinstalled on most computers, and though its tools are mostly far inferior, they are easy to use for beginners. Surely, Windows users could benefit from the Unix philosophy.”

Master Foo nodded again.

The student said: “How, then, are those enlightened in the Unix Way to return to the Windows world?”

Master Foo said: “To return to Windows, you have but to boot it up.”

The student said, growing agitated: “Master Foo, if it is so easy, why are there so many monolithic and broken software packages for Windows? Elegant software should also be possible with a GUI and fancy colors, but there is little evidence that this occurs. What becomes of an enlighted one who returns to Windows?”

Master Foo: “A broken mirror never reflects again; fallen flowers never go back to the old branches.”

Upon hearing this, all present were enlightened.

The Best Editor

Once a user went to the administrator and asked him: “I want to write code. I have heard about emacs, vi, joe, pico — please give me the best text editor available!”

“Every editor is the best one”, replied the administrator, “you can’t find any editor which is not the best.”

Upon hearing this, the user was enlighted.

The Poor Power User

Once a man came to Master Foo and complained: “I have heard that your Unix is so powerful. Yesterday, I have installed Linux on my computer. Now I have a very important and urgent job to do, but there is no powerful software like ACME Office on the system installed. Will you please give me a big program with enough features, so I can accomplish my task?”

Master Foo responded quietly: “You have Unix, the best wine in the country, and already finished three cups, and still you are saying that they did not even wet your lips.”

Not the OS, Not the Applications

Two programmers were arguing from where the power of Unix comes. One said: “The applications give us the power.”

The other said: “No, it’s the operating system kernel which enables the applications to be powerful.”

Master Foo happened to be passing by. He told them: “Not the applications, not the OS kernel; it’s the Unix spirit which gives us the power.”