Open a secondary application instance via Terminal

May 22, '07 07:30:01AM

Contributed by: zazzy

When you need to open a second instance of an application, you can user the sudo command. This is handy if you need to ensure that anything in the current instance is retained if the application crashes. For instance, for Safari I'd run the command...

sudo -u peter /Applications/Safari.app/Contents/MacOS/Safari &
The -u switch specifies which user to run the process under (you'd use the logged-in user's username). The ampersand at the end prevents gibberish from being displayed in the console window while the application is running. If you run the above, then open Activity Monitor (or use top), you'll see Safari running under two processes (as well as have two Safari icons in the dock).

[robg adds: This seems to work, though I'm not sure how things like preference files are handled when multiple copies of the app are in use.]

Comments (9)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070518091543709