Gracefully Close an Application from the Command Line in Mac OS X
Quitting apps gracefully is typically done through the appropriate application menu by choosing “Quit”, but the Mac GUI is obviously inaccessible from the command line of Mac OS X. So when most command line users are confronted with the need to exit an application, they wind up using the ‘kill’ command to terminate the process and forcibly quit the app, rather than issuing a ‘soft’ kill. The obvious problem with terminating an app is that while it does exit the application, you may lose data in that process, and even session restoration caches may not be adequate to restore the data. Thus, whenever possible, it’s usually best for users to gracefully quit an application instead.