How to find the username associated with a given UID

In Unix based systems, obviously...

I was curious one day to find where do some of the queued e-mail messages on a server originate from and since qmail only outputs something like "qmail x invoked by uid y" (where x and y are numbers obviously) I had to find out which user corresponds to y. After fiddling for a while without getting anywhere I resorted to asking around. And as usual the answer came quick from a good friend:

grep y /etc/passwd

Hmmm. Magic!

Posted in Tech on March 9, 2007 at 2:07 PM EET
Post a comment









Remember personal info?


Note Your e-mail will be kept private. If you leave a comment on an old(er) entry Movable Type might force it's moderation so I'll have to approve it before it appears.