The getpwuid function gets the next passwd record given the users identifier UID.
getpwuid UID
getpwuid 4711;