LinuxQuestions.org
Review your favorite Linux distribution.
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, 10: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, 11:36 AM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,166
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
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, 12:15 PM   #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, 12:29 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

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

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

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
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, 03:04 PM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,788
Blog Entries: 1

Rep: Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340
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 06:42 PM.
 
Old 02-11-2014, 11:34 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,162

Rep: Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205
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, 01:01 AM   #8
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,362

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 01: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 11:17 AM
Which country has the highest number of Linux users per capita? baldurpet Linux - General 18 07-19-2012 11:32 AM
[SOLVED] Perl: Find highest UID between 1000 and 2000 Angel2953 Programming 8 03-04-2012 10:00 AM
ps shows UID number, not name linuxbird Linux - Newbie 2 08-24-2008 05:35 PM
Distros: Highest number of packages ? Youssef_C Linux - Distributions 5 11-02-2005 07:32 PM


All times are GMT -5. The time now is 08:29 AM.

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