How to Log Out of Your Mac Using Terminal

Apple makes it simple to log off of your Mac with the choice within the desktop’s menu bar. But there are additionally a pair of instructions you should utilize to log off utilizing Terminal, as we’ll uncover right this moment.

Terminate the loginwindow Process

One means of logging out of your consumer account is by operating a command to terminate the loginwindow process. To get began, you’ll want to open Terminal. You can rapidly do that utilizing Spotlight Search.

Click the magnifying glass icon to the suitable of the desktop’s menu bar (or press Command+Space) to launch Spotlight Search.

The Spotlight Search bar will seem. Type “Terminal,” after which press the Return key or click on “Terminal” within the search outcomes.

Search for "Terminal" in Spotlight Search and press "Return."

Terminal will launch. Now, run this command:

sudo pkill loginwindow

Run the "sudo pkill loginwindow" command.

Next, enter your account password and press the Return key.

Enter your account password.

This will terminate the loginwindow course of, efficiently logging you out of your consumer account.

Use a launchctl Command

launchctl instructions are a set of instructions that management the launchd process. You can discover a record of launchctl instructions by operating launchctl assist in Terminal, however we would like to use the one which logs you out of your consumer account.

Before we begin typing instructions, you’ll want to know your consumer ID. To discover it, open Spotlight Search (click on the magnifying glass icon within the desktop’s menu bar or press Command+Space) and kind “Users & Groups” within the search bar. Press the Return key or click on “Users & Groups” within the search outcomes.

Search and open "Users and Groups" from Spotlight Search.

Click the padlock within the bottom-left nook of the window that seems.

Click the lock.

Now, enter your account password and click on “Unlock.”

Enter your password and click Unlock.

Next, right-click your account within the “Current User” group within the left-hand pane, after which click on “Advanced Options.”

Right-click your user name and then click "Advanced Options."

Finally, take a word of your consumer ID. You’ll want this for the command.

Find your user ID.

With consumer ID in hand, open Terminal (use Spotlight Search to seek for “Terminal” to open the app). In Terminal, run the next command (changing <consumer id> along with your ID famous earlier):

launchctl bootout consumer/$(id -u <consumer id>)

Run the launchctl bootout user command.

You’ll now be logged out of your consumer account.

This is only one of the various issues that you are able to do with Mac’s Terminal. You also can do issues like lock your Mac and even shut it down. Keep studying these primary instructions and also you’ll be a hacker very quickly!

RELATED: The Best “Just For Fun” Tricks Hidden in macOS’ Terminal

Source link

This Web site is affiliated with Amazon associates, Clickbank, JVZoo, Sovrn //Commerce, Warrior Plus etc.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *