I would like to run something like "sleep 3600; logout", but the logout bash command only closes the current terminal. How do I close the full Mac OS X session?
Macos – What Is the Mac OS X Terminal Command to Log Out the Current User
command linemacmacos
Best Answer
The following Applescript will logout the current user:
You can wrap this up in a bash alias using the
osascript
command:It is the same as clicking " > Log out [username]...", and will logout after a 2 minute wait
This is easily combined with the
sleep
command:..or could be combined into a single alias: