Google Answers Logo
View Question
 
Q: Unix chgrp question ( No Answer,   3 Comments )
Question  
Subject: Unix chgrp question
Category: Computers
Asked by: fairbro-ga
List Price: $5.00
Posted: 12 Jul 2006 08:11 PDT
Expires: 11 Aug 2006 08:11 PDT
Question ID: 745593
Hello
 
   What does it mean that the group is "(?)" for a file in Unix? The
other files have a gourp "user." I want to change the files listed as
group "user" so they will be the same as whatever the group "(?)" is.

Thank you
Answer  
There is no answer at this time.

Comments  
Subject: Re: Unix chgrp question
From: bozo99-ga on 12 Jul 2006 16:09 PDT
 
Is there a group defined with the name ? or (?)  ?
Or is this the way something (ls?) is trying to say no group is
defined?  ls normally displays a number in that situation.

If you've got perl (and Unix usually does) then what do you get from
this (replacing /tmp/F with the fileanme you want to test).


#!/usr/bin/perl

($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)=stat( "/tmp/F");
printf("U=%d, G=%d\n", $uid, $gid);

$group=getgrgid($gid);
if (defined($group)) {
    printf("GROUP=%s\n",  $group)
} else {
   printf("No group numbered %d\n", $gid);
}
Subject: Re: Unix chgrp question
From: bcwhite-ga on 17 Jul 2006 10:22 PDT
 
Your experience may vary depending on exactly what flavor of Unix you
are using, but assuming anything ever remotely standard, you can do:

 ls -ln

to see the user/group by numbers (first is user, second is group) instead of name.

You can then look the group number on the system in /etc/group.

 grep 12345 /etc/group

You'll probably find an entry like:

 (?):x:12345:

The first field in the group name, which is what is normally displayed
by "ls -l" when you don't use the "-n" option.

Note: If you're on a network, the group name may not be in /etc/group
but served by a network resources such as NIS, LDAP, or similar
service.  Talk with your local network administrator in that case.


To change the group-ownership of a file, just do

 chgrp 12345 whatever you wish to change

or

 chgrp "(?)" whatever you wish to change


Good luck!
Subject: Re: Unix chgrp question
From: langtusj-ga on 10 Aug 2006 17:35 PDT
 
the group is not valid.  It might happen when you create the group
before, then remove it

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy