LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I find the owner of a group? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-find-the-owner-of-a-group-4175476259/)

tarok 09-07-2013 01:10 AM

How do I find the owner of a group?
 
I created a group and added two users into it. I would like to find out the owner of the group, however I can't find a command for it.
After searching online, I could only find the command that tells me how to find the owner of a file and/or directory.

I tried using the same command, but it doesn't work.
ls -l group name

Thanks!

jdkaye 09-07-2013 01:31 AM

What makes you think that a group has an owner? Files have owners and folders have owners but groups?
jdk

druuna 09-07-2013 01:31 AM

A group doesn't have to have an owner. It doesn't even need any user(s) attached to it.

If you need to know which user(s) are associated with what group(s) you need to check both /etc/group and /etc/passwd. You need to check both files because the user isn't mentioned in /etc/group when this group is the primary group.

tarok 09-07-2013 01:35 AM

I'm doing an exercise for my class and it asks me to find out the owner of the group. If groups do not have owners, I will skip that question.

Thanks.

jdkaye 09-07-2013 01:41 AM

Ok, but please be aware of this LQ rule:
Quote:

Do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and searches) and we'll do our best to help. Keep in mind that your instructor might also be an LQ member.
Thanks,
jdk

rpmacaspac 09-08-2013 11:04 AM

just type in # ll (in the location of the files or folder)

for example: ll will output the following
#ll
total 1
-rw-r--r--. 1 root root 2407466 Feb 22 2013 System.map-2.6.32-358.el6.x86_64
| |
V V
owner group

you can change the group of file by

chgrp 'name of new group' 'file'
for ex.
#chgrp mygroup System.map*

273 09-08-2013 11:32 AM

How exactly is the question phrased and what, exactly, are you studying? I ask because the only time I have come across the concept of group owners is using Windows with Active directory. So if you're studying LDAP or SAMBA that might explain things and your question might have a different answer -- though I'm probably not able to answer it.


All times are GMT -5. The time now is 02:46 PM.