Mac OS X, Mac OS X Server Grab The Currently Logged In User On OS X February 13, 2013 You can ls /dev/console to see the currently logged in user of a machine. To do so: /bin/ls -l /dev/console You can also just grab the username, as follows /bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'