when a user presses the shutdown form the menu which process or file is called in return of this to shutdown the mac os
also the directory path of the process
Execute from the command line, or call osascript some other way with these arguments.
osascript -e 'tell application "Finder" to shut down'
Apple has a Technical Q&A about programmatically restarting, shutting down, or logout. (Thanks @NSGod)
shutdown -h now
sudo halt or sudo reboot also work. Read halt(8). AFAIK you'll have to be root because the /sbin/ directory where those programs reside isn't (shouldn't be) in your PATH by default.
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
4 years ago