So I've entered osascript -e 'tell application "System Events"' -e 'shut down' -e 'end tell' into a terminal window and pressed enter and it safely shutdown my system. If any applications have unsaved work, the shutdown would halt. Osascript -e 'tell application "System Events"' -e 'shut down' -e 'end tell' It would be like selecting "Shutdown" from the Apple menu: These are the basic macOS Terminal commands to know for updating a Mac, forcing an unresponsive Mac to shut down. If you want a more graceful method, I believe you could use AppleScript from the command line to send an apple event instead. macOS Terminal commands every Mac user should know. While it’s never an ideal way to close an application, it doesn’t generally hurt the app. This can happen when the app enters an infinite loop, crashes, hangs or otherwise ceases responding to user input. Using cron, you could make simple jobs that first use pmset to schedule the next startup, then execute a shutdown.Īs hayne said, the 'shutdown' command will not give any GUI processes an opportunity to save files and whatnot. When Mac apps misbehave, sometimes you need to force quit apps to shut down. You can modify these settings from the command line using 'pmset'. To run commands with superuser privileges, use the sudo command.sudo stands for superuser do. Ok I found this note and what he offers works! This is because the shutdown command can be run only by the root user or by an administrator user with root user privileges.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |