stat -f '%u %Su' /dev/console who NAME w – display who is logged in and what they are doing w SEE ALSO finger(1), ps(1), uptime(1), who(1) Link https://superuser.com/questions/180819/how-can-you-find-out-the-currently-logged-in-user-in-the-os-x-gui https://osxdaily.com/2014/03/25/see-users-who-connected-to-mac/