How do I get the name of the active user via the command line in OS X?
There are two ways-
whoami
or
echo $USER