Mac OS X Terminal Command to Find User Name & Primary Group

Getting-Started with Terminal Commands on Mac




Hello Mac User! The Tip Shows You How-to Find Your’s User Name and Primary Group on Mac OS X Terminal/Console.

The Commands are Intended for Execution on the Bash Shell but Most should Works also for the Bourne, C, TC and Korn Shells…

Mac Terminal Command to Find User Name & Primary Group - Featured

How-to Quick-Start with Command Line on Mac:

Mac Console Quick-Start
  • To Find Your’s User Name

    whoami



  • To Find Your’s User Primary Group

    id -g -n $(whoami)

    And for Another User:

    id -g -n [userName]