How to Lock the Mac Screen from Terminal in OS XWritten by Alex Tuesday, 13 February 2018 18:05
Open Terminal and enter the following in a single line:
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
Leave a comment
Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.