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 06-26-2005, 07:18 PM   #1
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Rep: Reputation: 30
How to list existing users?


Hi,

Looking for a command that shows me which users currently exist.

Cheers,
 
Old 06-26-2005, 07:19 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
cat /etc/passwd
 
Old 06-26-2005, 07:31 PM   #3
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
off course, thx!
 
Old 06-27-2005, 10:08 PM   #4
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
Following up from this is there also a way to list groups rather then users?
 
Old 06-27-2005, 10:17 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
cat /etc/group

 
Old 03-28-2006, 07:05 PM   #6
linuxlinux
LQ Newbie
 
Registered: Mar 2006
Location: Adelaide
Distribution: FreeBSD, Fedora C4, windows Server 2003
Posts: 15

Rep: Reputation: 0
cat /etc/group |grep [5-9][0-9][0-9]

if you don't want to list all the group
 
Old 03-28-2006, 07:32 PM   #7
Cindy5419
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
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?
 
Old 03-28-2006, 07:44 PM   #8
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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.
 
Old 03-30-2006, 01:11 AM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 03-30-2006, 08:49 AM   #10
demented_are_go
Member
 
Registered: Mar 2006
Distribution: Fedora Solaris Slackware
Posts: 50

Rep: Reputation: 15
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
 
Old 04-02-2006, 07:58 PM   #11
linuxlinux
LQ Newbie
 
Registered: Mar 2006
Location: Adelaide
Distribution: FreeBSD, Fedora C4, windows Server 2003
Posts: 15

Rep: Reputation: 0
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.
 
Old 04-03-2006, 01:03 AM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
  


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
Setting up chroot with existing users qwerty Linux - Security 1 11-03-2005 04:29 PM
Kick existing connected users loadedmind Linux - Security 4 07-26-2005 07:55 AM
Install with existing users?? Okie2003 MEPIS 6 06-02-2005 04:39 PM
List existing users anand_kt Linux - Newbie 3 02-28-2005 07:18 AM
Moving existing users from one Linux server to... xmdms Linux - General 7 03-04-2004 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:04 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
Open Source Consulting | Domain Registration