The command id can be used to both to look up UID and/or USER name
- look up a UID by USER, for example:
    $ id -u ubuntu
    1000
- look up a USER by UID, for example:
    $ id -un 1000
    ubuntu
 If the UID or USER is not found on current machine it prints no such user message to stderr, for example:
$ id -un 1234
id: 1234: no such user
 From man id:
id - print real and effective user and group IDs -n, --name print a name instead of a number, for -ugG -u, --user print only the effective user ID -g, --group print only the effective group ID -G, --groups print all group IDs
 
                