DEV Community

Cover image for Uptime of macOS system via terminal
Stan Kukučka
Stan Kukučka

Posted on

Uptime of macOS system via terminal

You are logged into your system. In this case, it's macOS. You are facing just a simple question. Are you the only one who is logged in? I would like to give you an answer to this simple question with a bit of explanation. Here in upcoming lines, there will be a bit of theory background behind it.

Your System Uptime

In case your system is healthy (understand as an official system with applied updates), you are the only physical user logged in. You can check this logged in information with a simple command you will enter into the terminal. But there is a trick in that, will explain in next lines hereunder. Open your Terminal.app you'll find out in Finder in the section Applications and Utilities. For more informations check official Terminal User Guide.

By entering uptime command you'll be informed in one line output about the current time, number of days your system is up, number of logged-in users etc.

uptime
Enter fullscreen mode Exit fullscreen mode

If you'll enter this very same command into the terminal in capital form as UPTIME, you'll receive a more readable summary of the logged-in sessions by the user.

UPTIME
Enter fullscreen mode Exit fullscreen mode

The same output can be given by entering w command into the terminal.

w
Enter fullscreen mode Exit fullscreen mode

Minimum of logged-in users

Do remember you will always have a minimum of 2 logged-in users. By default when you open another terminal session it will be counted as another active user logged in. In other words, if you open four-terminal sessions, you will see 4 users logged in +1 as the default logged-in user I have written about.

Top comments (0)