Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 07-12-2004, 02:37 AM   #1
LQ Newbie
Registered: Jul 2004
Posts: 23

Rep: Reputation: 15
How to get the list of all users

how to get the complete list of normal users.
ofcourse, /etc/passwd and /etc/shadow displays the complete list of users, both normal and system users. But i need to separate the normal users and system users.
where can i find this detail.
precisely, i need to know how redhat-config-users displays the system users and normal users separately.
I need the same for groups too :-)
Old 07-12-2004, 02:54 AM   #2
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
No idea about the RH app but a real basic thing (not at all guaranteed by rule, but the usual case) is that UIDs and GIDs for regular users added to the system start at a higher number (1000/100, 500/50, whatever) while system stuff is under that. Just a rule of thumb. Not sure if there's a solid precise way.
Old 07-12-2004, 05:06 AM   #3
LQ Newbie
Registered: Jul 2004
Posts: 23

Original Poster
Rep: Reputation: 15
thank you digiot,

what you said is absolutely correct.
regular users ofcourse have their user ids getting started from 500.
but, there is a system user " nfsnobody " with userid 65534 in my system.
i wish to know whether only nfsnoby has such high user id,
or is there any other such system users with high user id.
and if possible how to sort out the regular users.
thank you once again digiot :-)

Old 07-12-2004, 05:59 AM   #4
LQ Newbie
Registered: Jul 2004
Posts: 23

Original Poster
Rep: Reputation: 15
How to sort regular users and system users from /etc/passwd

how could i sort regular users from the complete list of users present in /etc/passwd.
usually regular users has user ids starting from 500.
there is a system user "nfsnobody" with user id 65534 in my system,
for which, the /etc/passwd entries are as below.

nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin

if suppose i should blindly sort users according to the user id, like...user id's above 500...,
the above said system user also gets included in that.
and moreover, there might be other system users having such high user ids.

please let me know if any other method is used to retrieve the complete list of regular users.
and i wonder how the redhat-config-user application displays the system users and regular users separately. If you could help me with the technique followed in redhat-config-users,
that would be more helpful to me.

i need to list out all the regular users, with their user id, group id, password change date, etc...
my foremost need is to list all the regular users separately.

thanks 'n regards,
Old 07-12-2004, 06:02 AM   #5
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 471Reputation: 471Reputation: 471Reputation: 471Reputation: 471
JoeyBig - you will notice that I have merged your threads. This is because they are pretty much the same question, the later one giving more detail. Please do not double post.
Old 07-12-2004, 07:05 AM   #6
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Rep: Reputation: 15
If you want to sort the regular users from the system users by using their IDs , or any other search string , then you can use either grep or awk with regular expressions.

You will need to supply the range of the IDs or a search string common to one group or the other to do the search for either the regular or system users.

grep is easy to use , but awk is a far more powerful utility to use.
Read up on both grep and awk first to see exactly what they can do.

Last edited by sandgroper; 07-12-2004 at 07:07 AM.
Old 05-27-2008, 02:11 AM   #7
LQ Newbie
Registered: May 2008
Posts: 2

Rep: Reputation: 0

i want to get the list of regular or normal users from /etc/shadow please help me asap
thanks in advance
Old 05-27-2008, 02:14 AM   #8
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can you define normal users as those with a directory in /home?
Old 05-27-2008, 02:27 AM   #9
LQ Newbie
Registered: May 2008
Posts: 2

Rep: Reputation: 0
ya ths right what i meant by normal users are those who r in /home
Old 05-29-2008, 12:59 AM   #10
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
This'll give you users with a /home dir: username, userid, grpid

grep /home /etc/passwd |cut -d: -f1,3,4


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
Showing Users from passwd kemplej Programming 1 12-30-2004 10:10 AM
regular users using halt TimmyP Debian 4 11-08-2004 03:06 AM
Network up/down by regular joe users bluefire Linux - Networking 1 08-22-2004 03:26 PM
change permissions for regular users... questionasker Linux - General 6 01-26-2004 01:07 PM
allowing regular users to shut down abyss Linux - General 1 08-30-2002 12:39 PM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:23 PM.

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