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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-26-2005, 07:18 PM
|
#1
|
|
Member
Registered: Jun 2005
Distribution: Centos
Posts: 215
Rep:
|
How to list existing users?
Hi,
Looking for a command that shows me which users currently exist.
Cheers,
|
|
|
|
06-26-2005, 07:19 PM
|
#2
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,902
|
cat /etc/passwd
|
|
|
|
06-26-2005, 07:31 PM
|
#3
|
|
Member
Registered: Jun 2005
Distribution: Centos
Posts: 215
Original Poster
Rep:
|
off course, thx!
|
|
|
|
06-27-2005, 10:08 PM
|
#4
|
|
Member
Registered: Jun 2005
Distribution: Centos
Posts: 215
Original Poster
Rep:
|
Following up from this is there also a way to list groups rather then users?
|
|
|
|
06-27-2005, 10:17 PM
|
#5
|
|
Moderator
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,505
Rep: 
|
cat /etc/group

|
|
|
|
03-28-2006, 07:05 PM
|
#6
|
|
LQ Newbie
Registered: Mar 2006
Location: Adelaide
Distribution: FreeBSD, Fedora C4, windows Server 2003
Posts: 15
Rep:
|
cat /etc/group |grep [5-9][0-9][0-9]
if you don't want to list all the group
|
|
|
|
03-28-2006, 07:32 PM
|
#7
|
|
LQ Newbie
Registered: Feb 2006
Posts: 2
Rep:
|
I'm just a newbie as well, but couldn't you just use "who" to see who is logged on to the system? Also, I'm not sure but can't you also use "groups" for the groups?
|
|
|
|
03-28-2006, 07:44 PM
|
#8
|
|
Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
Quote:
|
Originally Posted by Cindy5419
I'm just a newbie as well, but couldn't you just use "who" to see who is logged on to the system? Also, I'm not sure but can't you also use "groups" for the groups?
|
"groups" will only show group info about yourself or a specific user. "who" will only list people logged into the system, but not every user that has an account on the system.
|
|
|
|
03-30-2006, 01:11 AM
|
#9
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,902
|
Quote:
|
Originally Posted by linuxlinux
cat /etc/group |grep [5-9][0-9][0-9]
if you don't want to list all the group
|
In fact it doesn't list a single one on my machine(s) ;}
Cheers,
Tink
|
|
|
|
03-30-2006, 08:49 AM
|
#10
|
|
Member
Registered: Mar 2006
Distribution: Fedora Solaris Slackware
Posts: 50
Rep:
|
and... If you want just the username listed and not the whole line you can just use :
awk -F: '{ print $1 }' /etc/passwd
For groups... just replace /etc/passwd by /etc/group
|
|
|
|
04-02-2006, 07:58 PM
|
#11
|
|
LQ Newbie
Registered: Mar 2006
Location: Adelaide
Distribution: FreeBSD, Fedora C4, windows Server 2003
Posts: 15
Rep:
|
Quote:
|
Originally Posted by Tinkster
In fact it doesn't list a single one on my machine(s) ;}
Cheers,
Tink
|
Well when i tried with this on my machine this is what i found,
[root@unisa ~]# cat /etc/group |grep [5-9][0-9][0-9]
nfsnobody:x:65534:
Harrison:x:500:
steve:x:501:
superusers:x:502:
may:x:503:
test:x:504:
[root@unisa ~]#
Well may be i could be wrong, Sorry If is was wrong,
Cheers
Linux
Last edited by linuxlinux; 04-02-2006 at 08:00 PM.
|
|
|
|
04-03-2006, 01:03 AM
|
#12
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,902
|
Quote:
|
Originally Posted by linuxlinux
Well when i tried with this on my machine this is what i found,
[root@unisa ~]# cat /etc/group |grep [5-9][0-9][0-9]
nfsnobody:x:65534:
Harrison:x:500:
steve:x:501:
superusers:x:502:
may:x:503:
test:x:504:
[root@unisa ~]#
Well may be i could be wrong, Sorry If is was wrong,
Cheers
Linux
|
That's not "wrong" - but it's limited to your distros
view of the linux world. To create a group per user
is not necessary, it's something that DeadRat based
distros for instance will do.
Cheers,
Tink
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:37 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|