There is a command id to get the user id. E.g. id -u rootgives me 0. Is there an opposite command to get the user name via the id?
I know I can grep /etc/passwdor run getent and awk or cutthe result. My question is if there is a dedicated command or utility I don't know?
Update:
Note that the accepted answer id -un UID requires recent coreutils.
E.g. on Ubuntu 14.04 LTS you get:
> id -un 0
id: 0: no such user