Re: How do I get the user name from the uid?



On Fri, 10 Nov 2006 05:18:36 -0500, Chris F.A. Johnson wrote this:

On 2006-11-10, noi wrote:
On Thu, 09 Nov 2006 22:52:46 -0500, Chris F.A. Johnson wrote this:

On 2006-11-09, Jordan Abel wrote:
2006-11-09 <1163099433.267943.287320@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Timur Tabi wrote:
In the shell, how do I get the user name from the user ID (uid)?
Basically, I'm looking for the opposite of the 'id' command. I've
searched and searched, but I can't find the answer.

the id command can't do this?

No; id takes a USERNAME, not a UID.

I should have been more explicit in my reply

$ id -un

Where's the UID for which the OP wants to get the USERNAME?

Ok I understand and I'm corrected. .
.



Relevant Pages

  • Re: get logged in username
    ... custom nss module. ... username - not the UID - to operate well. ... How can I get the logged in username under remote command execution? ...
    (SSH)
  • Re: Strange top(1) output
    ... This could affect the width of the USERNAME ... > users (and if it's not there is always they UID view). ... I'm currently trying to get top to display ... prstatcommand of recent Solaris versions. ...
    (freebsd-stable)
  • Re: How do I get the user name from the uid?
    ... I'm looking for the opposite of the 'id' command. ... Where's the UID for which the OP wants to get the USERNAME? ...
    (comp.os.linux.misc)
  • Re: Commands for changing ownership of a file
    ... and besides os.chown(where you ned the uid and gid), you could also use subprocess.callor subprocess.Popen ... ownership of the files created in the script to that of my username. ... the command is something like "chown myusername:users". ... A-1090 Wien, AUSTRIA cmp.mpi.univie.ac.at ...
    (comp.lang.python)
  • Re: Query for blank passwords in Active Directory
    ... Depending on your Domain Controllers configuration, it may be extremely easy to enumerate users, even without having credentials for accessing the AD domain. ... If rpcclient's "enumusers" command doesn't work, it may still be possible to get the users list scanning for SIDs. ... If you're stuck on Windows as testing plaform, you should also take a look at enum.exe. ... username as well as username = password). ...
    (Pen-Test)