How Do You Find the User ID In Linux/Unix When You Only Have the Username?

Problem scenario: You know the Linux username that you want to use. But you do not know its corresponding UID or GID. How do you find the UID when you only know the username?

Solution
Use the id command. For example:

id jdoe

The results will give you the UID and GID.

Leave a comment

Your email address will not be published. Required fields are marked *