O'Reilly logo

Mac OS X Hacks by Rael Dornfest, Kevin Hemenway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required