Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-07-2005, 09:36 AM   #1
LQ Newbie
Registered: May 2004
Location: Ottawa, Ontario, Canada
Distribution: Redhat 9
Posts: 20

Rep: Reputation: 0
bash command that lists all members of a group by their real names


I'm writing a manual for Linux newbies and I am looking for a command that would list all members of a group by their real names (our network logins are pretty cryptic and useless).

Doing the command:
cat /etc/group | sort

is too much info and gives out the cryptic logins.

For example, in /etc/passwd I am listed as:
bszogh:x:1017:502:Bertrand Szoghy:/home/d00bsz:/bin/bash

I want a command such as:

showmembers <groupname>

which would display:

Bertrand Szoghy
Jane Doe
John Doe

Old 11-07-2005, 09:39 AM   #2
Registered: Feb 2004
Location: Switzerland
Distribution: Fedora - RedHat - Mandrake - OpenSuse
Posts: 216

Rep: Reputation: 35
Just go into a bash shell and type twice the Tab button. You will have a list of all the commands.
Old 11-07-2005, 09:40 AM   #3
Registered: Oct 2005
Location: Swansea, UK
Distribution: Slackware // Mandriva
Posts: 32

Rep: Reputation: 15
If you man the users command, I am pretty sure that there is an option that prints out the names of the users, and not their IDs.

I would check for you but at the moment I am stuck in my Windows sysyem in the Uni Library.
Old 11-07-2005, 09:42 AM   #4
LQ Newbie
Registered: May 2004
Location: Ottawa, Ontario, Canada
Distribution: Redhat 9
Posts: 20

Original Poster
Rep: Reputation: 0
Thumbs down

Display all 1722 possibilities? (y or n)

Not useful, that's why I posted here after googling the group commands.

Old 11-07-2005, 10:46 AM   #5
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,096

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
OK, you need a hint or two?
man cat
man cut
man grep
man sort
man sed (but the above should be enough!)

Oh, and don't forget the | ("pipe") operator (see man bash)

Have fun


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
real names? Joey.Dale General 157 06-14-2006 07:55 PM
winbind: group members? eantoranz Linux - Software 0 11-01-2005 08:47 AM
-h not valid for CLI command free, yet it lists as an arg??? Lleb_KCir Linux - Software 2 07-18-2004 11:07 PM
Group members and rights EERookie Linux - Newbie 0 06-03-2004 08:19 AM
AbiWord lists lpr -P(null) as its print command. Why? andrewstr Linux - Software 0 03-05-2004 04:58 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:14 AM.

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