Hot answers tagged

50

The command you are after is shutdown. This informs all users that the machine is going to be shutdown and tells all apps to close files etc. The command takes a parameter -h, -r or -s to shut down, restart or sleep the Mac. The command has to be run as root so you need to use sudo. e.g. to reboot the machine immediately sudo shutdown -r now


39

Shut down without showing a confirmation dialog: osascript -e 'tell app "System Events" to shut down' Shut down after showing a confirmation dialog: osascript -e 'tell app "loginwindow" to «event aevtrsdn»' Restart without showing a confirmation dialog: osascript -e 'tell app "System Events" to restart' Restart after showing a confirmation dialog: ...


17

Shutdown vs. Sleep is a constant question. It used to be that shutting down the early OS X machines caused issues with timed log cleanup routines. That's pretty much a non-issue these days as the OS recognizes when the routines haven't run and will reschedule them. Another concern has been restarting to free up memory or just make the machine more stable. ...


16

Ok, so further to my previous answer, I can walk you through getting cron (a built in UNIX schedule service) to run a scheduled shutdown command for you. It will run as root and will be forced. Open Terminal (/Applications/Utilities/Terminal) Input sudo crontab -e You'll need to enter your login password and then press enter. You'll now be in a text ...


14

No, it's only recommended when unplugging the cable. The reason why you eject is so that any processes reading and writing from the disk will cause OS X to notify you of the disk being in use and prevent data corruption that can occur by just unplugging the disk while it's in use. Additionally the OS might queue different write operations to a cache before ...


12

All you need is to open Terminal.app and type: sudo shutdown now That way the system will be forced to terminate all open programs, ignoring any unsaved file changes. So, in order to be able to launch it via the desktop, you need to open Applescript editor, and type: do shell script "shutdown now" with administrator privileges Save the script as an ...


11

You can safely leave your Mac powered on all the time. Safe and Harmless There is no practical damage or harm that will occur because the Mac is constantly running. Use your Mac as best suits your needs. Restarting is helpful every so often – if only to install updates and clear out caches or temporary files. Environment As 1lann mentions, environmental ...


10

It can be canceled though: Halt at yymmddhhmm: shutdown -h 1109211555 Halt in 4 minutes: shutdown -h +4 /Library/LaunchAgents/me.lri.forceshutdown.plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> ...


9

This can be scheduled in System Preferences > Energy Saver > Schedule. I'm not certain that this will initiate a forced shutdown, you'd have to try it out. But that's a built in option to automate scheduled power down/up. You can also forcibly shutdown the system with a terminal command (requires root): shutdown -h now You could put that command into a ...


9

From your screenshots, it looks like you had a kernel panic. A kernel panic is an action which an OS takes due to a fatal error. More info on Wikipedia about kernel panics. From Apple's support doc about kernel panics: In most cases, kernel panics are not caused by an issue with your Mac. They are most likely caused by an issue external to your Mac. If ...


9

Whether to shut down or keeping it in sleep state (by closing the lid) depends on the time usage in between. The short answer is: If you use it daily, enter sleep mode is recommended. If you rarely use it, shut it down. So let‘s see the difference between each option. We’ll start with this statement: An interesting opinion - cannot find the link for ...


8

You can just launch any app while the Mac is shutting down and that'll terminate the process.


7

You can send loginwindow the kAEShowShutdownDialog Apple event: osascript -e 'tell application "loginwindow" to «event aevtrsdn»' The four letter codes for Apple events are listed in AERegistry.h. See this answer for more information.


7

I have a fairly generic (mathematical) answer, but can only find some of the actual numbers. After finding the 2010 Mac Mini Environmental Report from Apple, there are four important numbers: Tbooting = The time taken to boot up and shut down (s) Pbooting = The power consumption while booting or shutting down (W) Psleep = The power consumption while ...


6

You don't need to map the power button, that menu is already mapped to control+eject Other useful shutdown/restart/logoff key mappings are below which might be of interest too Prompt to save work and restart the Mac - Control+Command+Eject Prompt to save work and shutdown the Mac - Control+Option+Command+Eject Sleep - Command+Option+Eject ...


6

You can do the following to make it a little bit harder to quit Adium by accident. I think this should solve your problem. Start by opening System Preferences > Keyboard. Click Keyboard Shortcuts in the pillbox above. Make sure you have Application Shortcuts selected in the left bar. Click the + button to add a new shortcut. Select Adium from the ...


6

Edit: since 10.7.4, the "Reopen windows when logging back in" checkbox has stayed unchecked if you uncheck it once, so the hacks below are not needed anymore. One option is to set the LoginwindowLaunchesRelaunchApps key to false in ~/Library/Preferences/com.apple.loginwindow.plist: defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool ...


6

There is nothing to gain from explicitly "ejecting" drives before logging pout, shutting down, or restarting in a normal fashion. MacOS X has a subsystem called "Disk Arbitration" (primarily the system daemon process "diskarbitrationd") which mounts drives other than the boot device when a user logs in and unmounts (a.k.a. "ejects") them when the user logs ...


6

You've asked what you want, but not why you want it. I am guessing that this is a preconception that you think it needs to complete in order to be successful. Time Machine isn't just a standard "backup job" that will create individual backups that depend on the success of each backup, it's more a permanent process. Effectively each time you change a file, ...


6

Typing Ctrl + ⏏ brings up the shutdown dialog window, which is a bit faster than clicking the Apple menu.


6

If you don't care about saving the session, you can simply hit Ctrl + Option + ⌘ + ⏏ for Shutdown or Ctrl + ⌘ + ⏏ for Restart You can also check out this post (Disable "Reopen Windows") on disabling resume if you don't want that. There is another solution posted here on Apple's forums for disabling the feature by William Donelson (second post by him on the ...


5

You have a couple options: Simply let the phone discharge until it turns off. Then, you can charge it again and it should turn on when it reaches a high enough battery level. If you dare, you can reset the device's network settings which will restart it (but obviously, also clear your network settings). You can use Assistive Touch (Settings > ...


5

From Apple's support page, hold the power button for 1.5 seconds and let go to get the power dialog. Don't hold it too long though, as it only takes 5 seconds to turn off the system without a proper shutdown. You can also get the dialog immediately by holding control and pressing either the eject key or power button, or use the Apple menu to access the ...


5

I have the same issue with my Macbook Air after a very small amount of coffee hit the keyboard. Apple store wanted to gut for $800+. It was less then a year old and I was dropping another $800 into it. What has worked for me for the last 6 months, I pressed the eject button down and wedged a toothpick to hold it down, than cut off the excess. Everything ...


5

From the shutdown man page: Upon shutdown, all running processes are sent a SIGTERM followed by a SIGKILL. The SIGKILL will follow the SIGTERM by an intentionally inde- terminate period of time. Programs are expected to take only enough time to flush all dirty data and exit. Developers are encouraged to file a bug with the OS vendor, should they ...


4

One way I can see potential damage is wear and tear of moving parts inside the computer, such as any hard disk drives and fans. Be aware that the fan may draw in a lot of dust if the computer is constantly running, and you may need to clean the inside of your computer at one point.


4

I administer a small network of Macs, servers and iOS devices and have been doing exactly the same thing for many years, I personally think (although can't confirm) that it adds longevity to the machine, I currently have a mac mini that is 8 years old running perfectly using this practice.


4

Chances are this is a bad power supply board. Shutdown error codes can be negative or positive values; negative being hardware and positive being software. A "0" code is right there in the middle where it usually means a sudden loss of power. See this post for more info: Are OS X shutdown cause and sleep cause numbers listed/explained anywhere? If any ...


4

I have the same problem with my iPod touch. In settings, go to "General">"Accessibility" and turn AssistiveTouch on. You will have a little square with a circle appear on your screen. tap that to open it up, and there will be a lock screen button. Press and hold this, and just like with the lock button, the "slide to power off" will appear. Good Luck! Of ...


4

No, with the exception of restarts for software updates, shutting down your iMac or Mac Mini is not necessary. You are quite correct that you can put your device to sleep for long periods of time or even leave your device up and operating without causing any damage to the device, so long as proper precaution is taken to ensure surge protection for your ...



Only top voted, non community-wiki answers of a minimum length are eligible