LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-07-2009, 05:56 AM   #1
ari5
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
Users and Groups


hello i want to print all the users and which group are they belong does anynone can help me?????????
 
Old 06-07-2009, 06:06 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Check /etc/passwd and /etc/group and read
Code:
man id
 
Old 06-07-2009, 06:06 AM   #3
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
You should iterate over the struct group* entries returned by getgrent().
See getgerent(3) and getpwuid(3)
 
Old 06-07-2009, 06:32 AM   #4
ari5
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Smile Thanks

thanks you help me a lot
 
  


Reply



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
System Groups from Users and Groups measekite Linux - General 3 05-05-2009 09:22 PM
Users and groups ssmaitra Linux - Newbie 5 12-11-2005 06:10 AM
What are users and what are groups? harisund Linux - Newbie 5 12-06-2005 12:33 PM
groups and users twb2005 Linux - Newbie 7 10-10-2005 06:21 PM
users and groups krfulton Linux - Security 1 01-05-2004 03:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10: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