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

