How to edit ~/.MacOSX/environment.plist from a shell

This post is for me. I’ve wasted too much time trying to figure out how to edit environment.plist by hand from a shell without resorting to XCode’s property editor. The solution is simple, even if a Google search refuses to quickly and easily address the issue.

  1. Open up a terminal.
  2. mkdir ~/.MacOSX; touch ~/.MacOSX/environment.plist
  3. defaults write ~/.MacOSX/environment PATH "/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql90/bin"

Want to check your work?

defaults read ~/.MacOSX/environment

{
PATH = “/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql90/bin”;
}

Advertisements
This entry was posted in OSX and tagged . Bookmark the permalink.

One Response to How to edit ~/.MacOSX/environment.plist from a shell

  1. Eli says:

    thanks for the post. Helpful info.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s