The other day after I just brewed a fantastic single origin specialty coffee from Peru I got a message from one of my clients. They wanted to find out how to logout a user Using macOS Terminal. They needed to do this in order to install new printers and the user’s screen was locked. All the macs were joined to Active Directory. So there was no ‘switch between accounts’ options at the login screen.
I have been using macOS Terminal for a while, but I still have a long way to go and learn. There are so many options in the Terminal that differ from the Linux command line.
The command to logout a user Using macOS Terminal is quite simple. Open your Terminal in you mac and run:
sudo launchctl bootout gui/$(id -u <username>)You need admin rights. The above will logout a user from the GUI and return you to the login screen.
Hope this very short tutorial helps somebody out there. Thank you and have a great day. If you like, you can support me by shopping one of my IT Handy man T-Shirts and coffee mugs below.
Recommended products
Code With Coffee Mug with Color Inside 11oz
$20.00IT Handyman Coffee Mug White
$16.00Code with Coffee Short-Sleeve Unisex T-Shirt
Price range: $24.00 through $28.00Holiday Bash Coffee Mug for $bash lovers 11oz
$20.95





