On 6/6/05, Andreas Jaeger <aj@suse.de> wrote:
Markus Natter <markus.natter@gmail.com> writes:
Hi list,
this is an odd problem, yet simple..
I could not find a command line tool that would return me the user name belonging to a UID (number) independent from the underlieing auth mechanism.
It should be kind of a reverse "id" command.. the way an "ls" uses it.
It seems so trivial to me, but I didn't find an answer googling for it.
Try: getent passwd uid
Followed by some awk...
Andreas
Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
first of all I'd like to thank you for the suggestions, but is there also a passwd or other backend independent way? ( e.g. if you have users in passwd and LDAP, or NIS.. ) What does "ls" do to? I think it uses a kind of an abstraction layer, as it seems to ask any underlieing authentication mechanism and nscd.. Markus