user id number
Hi all,
how to find what is the max id number that is been assigned to a user in linux ? /etc/passwd file might have it but not sure how to find it if it has too many entries in it ? and also what is the range of id's can be used in linux ? Thanks in advance! |
/etc/login.defs defines the max and min uids and gids. There is no formal way to find out the current max UID, as it's not an interesting thing to want to know. you can easily spit the output of "getent passwd" through cut and the likes though.
getent passwd | cut -d: -f4 | sort -n | tail -n1 |
Code:
awk -F":" 'END{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd |
Quote:
|
Quote:
|
Thanks everyone for quick and exact solution!!!
|
All times are GMT -5. The time now is 12:07 PM. |