How do I get the name of the active user via the command line in OS X?
whoami
EDIT
The whoami utility has been obsoleted by the id(1) utility, and is equivalent to id -un. The command id -p is suggested for normal interactive use.
id -un
id -p