Wednesday, April 18, 2012

Finding the user id of a user

Every user in linux is recognized by a unique user id. Here are a few ways you can find out the user id of a user.

1. Login as the user whose user id is to be found out
2. Open a terminal
3. Run the command


The number that will appear as the output is the user id of the currently logged in user.

If you want to know the user id of user with out logging in as that user .

The easiest way is mentioned in the first comment below (updating the blog after receiving the comment )

Another more round about way is to use the script shown below.

uid_script:


Save the script and give execute permissions.
Execute the script



output:



0 comments:

Post a Comment