logname

A utility of coreutils, which Print the name of the current user

Posix API: getlogin