Mac: Logout a user from the command line

You don’t have to use the macOS UI to logout a user. Instead, in the Terminal use:
1
2
3
sudo launchctl bootout gui/$(id -u <username>)
# or
sudo launchctl bootout user/$(id -u <username>)
Works on macOS 10.11.x or later.
Leave a Comment
Your email address will not be published. Required fields are marked *