Editing Special Unix Files

Special Unix files need special handling. You can’t simply edit them in Word and expect things to work. Here’s a crash course in editing using the pico command-line editor and TextEdit GUI editor.

You’ve no doubt discovered OS X’s default text editor, the aptly named TextEdit. Hopefully, you’ve also heard of and downloaded the outstanding BBEdit (http://www.bbedit.com/index.html), favorite text editor of generations of Mac users. But unless you’re a Unix jock, you probably don’t know that OS X ships with several other feature- and history-rich Terminal-based text editors. Veterans will tend to swear by either vi (the Visual Editor) or Emacs, but seldom both. Then there’s pico, the simplest of the three, yet still more than sufficient for most simple editing work.

Here we’ll provide a crash course in editing those special Unix files we talk about in this book: httpd.conf, /etc/inetd.conf, plist files, and the like. We’ll skip the two with the steepest learning curve — vi and Emacs — and stick with pico and TextEdit.

Using pico

pico was developed at the University of Washington. It is a simple but powerful Unix text editor. To fire up pico, type pico (by itself or followed by a particular file to edit) in a Terminal [Hack #48] window (see Figure 5-14).

The pico interface

Figure 5-14. The pico interface

pico’s interface, while perhaps a little Unixey for the uninitiated, ...

Get Mac OS X Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.