Category Archives: shell

A Quick Introduction to sed(1)

The sed(1) stream editor is one of the most powerful tools from the classic Unix tool box. It is a close cousin to the ed(1) command line editor and a descendant of the ex(1) editor, the command line mode of … Continue reading

Posted in shell, tools | Tagged , , | Leave a comment

Quick Tip #6: Triggering Actions on File Close

Sometimes it’s useful to trigger an action after a file is closed. Suppose you started a lengthy download on your notebook and you want to suspend it as soon as the download is done. There are several ways to achieve … Continue reading

Posted in shell | Tagged , , , | Leave a comment

Quick Tip #5: Navigating in Source Trees

I often move around in checked out Subversion or Git source trees on a Bash command line. Directory structures tend to get quite deep (especially in Java projects), so one problem keeps coming up frequently: Changing back to the base … Continue reading

Posted in shell | Tagged , , | Leave a comment

Bourne Shell Parameter Expansion

Classic Bourne Shell has a handy feature that many people don’t seem to know: Parameter Expansion. Stephen Bourne describes it in An Introduction to the UNIX Shell, which is part of the original Unix V7 manuals from 1978. Among other … Continue reading

Posted in shell | Tagged , | 3 Comments

Scripts That Just Don’t Work

Sometimes people ask for my help when their shell scripts don’t work. I’ve seen all kinds of problems, ranging from trivial to really, really weird. The one I’m describing in this article is definitely from the weird category, but I’ve … Continue reading

Posted in shell | Tagged , , | 2 Comments

Quick Tip #4: Sorting Large Files

With traditional Unix sort(1), the size of the files you can sort is limited by the amount of available main memory. As soon as the file gets larger and your system has to swap, performance degrades significantly. Even GNU sort … Continue reading

Posted in shell | Tagged , , , , | 2 Comments

Quick Tip #2: Set Operations Using Shell Tools

Everybody knows that Unix shell utilities are powerful. Even though they’re text-based, you can build a lot of useful things outside of the text domain. Today I’ll show you how to implement set operations. All we need are sorted files … Continue reading

Posted in shell | Tagged , , , | Leave a comment