Using BBEdit to work on system files
Apr 22, '01 05:18:47PM
Contributed by: Anonymous
No need to learn vi or pico to edit system files, you can use the great BBEdit editor to work on system text files.
Read the rest of this article if you'd like to make it easy to open BBedit from the terminal to work on system files! Thanks to Marc L. for submiting this tidbit!
Type in these commands in a shell, exactly like they are listed here (It's best to copy/paste them):
- sudo mkdir /usr/local/bin/
It's OK if it says "File exists". Type in the adminstrator password when asked. - sudo echo #!/bin/sh >> /usr/local/bin/bbopen
- sudo echo open -a '"/Applications/BBEdit/BBEdit 6.1 for OS X"' $* >> /usr/local/bin/bbopen
- sudo chmod 755 /usr/local/bin/bbopen
- rehash
This assumes you installed BBEdit into the default location, otherwise you need to change line 3. Now you can type the command bbopen followed by the name(s) of the file(s) you want to open.
Example: bbopen /etc/motd will open the file /etc/motd in BBEdit.
If you need to edit files which are owned by the superuser, you can type sudo before bbopen, but be very careful when you do this.
BTW, this also works with the TextEdit application that's included in Mac OS X:
open -a TextEdit filename will open filename in TextEdit.
Comments (15)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010422171847857