LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2014, 09:18 AM   #1
jithinjjc
LQ Newbie
 
Registered: Feb 2014
Posts: 1

Rep: Reputation: Disabled
How to find out the highest UID number?


i am using linuxcentos system .my question is how to find out the highest UID number of the system using terminal please help me urgently
 
Old 02-11-2014, 10:36 AM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 7,799
Blog Entries: 11

Rep: Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103
Welcome to LQ.

Your question leaves us with 2 possible replies..
The highest UID allowed, or the highest UID assigned?

Please refer to https://en.wikipedia.org/wiki/User_identifier
and reply.

NOTE: We're volunteers here, "urgently" doesn't work.
 
Old 02-11-2014, 11:15 AM   #3
pingwinowiewc
Member
 
Registered: Feb 2014
Location: Europe
Distribution: Debian, Mint, Arch (multiboot)
Posts: 90

Rep: Reputation: Disabled
UUID is assigned automatically once you connect with wireles network. Each network has its own way of doing it. Ask network root.
 
Old 02-11-2014, 11:29 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,061

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
i think /etc/passwd contains uid:gid (you can probably awk | sort | tail that file).

Last edited by schneidz; 02-11-2014 at 11:41 AM.
 
Old 02-11-2014, 01:46 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,488

Rep: Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970
Quote:
Originally Posted by pingwinowiewc View Post
UUID is assigned automatically once you connect with wireles network. Each network has its own way of doing it. Ask network root.
The OP is asking about UID...NOT UUID.
 
Old 02-11-2014, 02:04 PM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,184

Rep: Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584
Well,.. thinking off the top of my head here

Code:
cut -f 3 -d: /etc/passwd | sort -n | tail -n 1
Or if the OP is actually looking for the highest UUID,.. i would have to ask 'why?'

Last edited by szboardstretcher; 02-11-2014 at 05:42 PM.
 
Old 02-11-2014, 10:34 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,660

Rep: Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439
You might not be able to do it at all.

If the passwords are obtained from a conventional /etc/passwd file, then you can potentially scan that file to locate the highest number. But, on a typical corporate system, that file is not maintained, and it is not the source of user-ID information at all. Instead, a central directory-management authority (e.g. LDAP) is used to maintain this information.
 
Old 02-12-2014, 12:01 AM   #8
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,363

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by jithinjjc View Post
i am using linuxcentos system .my question is how to find out the highest UID number of the system using terminal please help me urgently
Hi jithinjjc, welcome to LQ.

You can find something like this in the file /etc/login.defs, where its defined the max UID that will be assigned to user.
You can change the value also.

PHP Code:
#
# Min/max values for automatic uid selection in useradd.
#
UID_MIN                   500
UID_MAX                 60000 
And to find the current assigned max UID check the /etc/passwd file.

Last edited by divyashree; 02-12-2014 at 12:02 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a hidden user on a desktop for admin purposes, need to find a free UID number hackersarchangel Linux - Desktop 11 11-30-2012 10:17 AM
Which country has the highest number of Linux users per capita? baldurpet Linux - General 18 07-19-2012 10:32 AM
[SOLVED] Perl: Find highest UID between 1000 and 2000 Angel2953 Programming 8 03-04-2012 09:00 AM
ps shows UID number, not name linuxbird Linux - Newbie 2 08-24-2008 04:35 PM
Distros: Highest number of packages ? Youssef_C Linux - Distributions 5 11-02-2005 06:32 PM


All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration