Operating System - HP-UX
1822546 Members
2763 Online
109642 Solutions
New Discussion юеВ

"ls -l" showing group id instead of group name...

 
Kevin_31
Regular Advisor

"ls -l" showing group id instead of group name...

This seems like it must be obvious, and perhaps if it "was a shark it would have already bitten me" but I've got a hpux 11.00 box which shows the group id number when I do a listing of any files (rather than showing the group name):

root@badbox:/> ls -la /etc | tail
lr-xr-xr-t 1 root 3 19 Aug 1 2001 vtgateway -> /usr/sbin
/vtgateway
lr-xr-xr-t 1 root 3 18 Aug 1 2001 vtserver -> /usr/sbin/
vtserver
drwxr-xr-x 4 bin 2 96 May 31 2001 vue
lr-xr-sr-t 1 root 3 14 Aug 1 2001 wall -> /usr/sbin/wall
lr-xr-xr-t 1 root 3 15 Aug 1 2001 whodo -> /usr/sbin/who
do
lrwxrwxrwt 1 root 3 13 Aug 1 2001 wtmp -> /var/adm/wtmp
-rw-r--r-- 1 root root 18 Jan 28 09:21 xtab
lr-xr-xr-t 1 root 3 9 Aug 1 2001 yp -> /usr/sbin
lr-xr--r-T 1 root 3 25 Aug 1 2001 ypbind -> /usr/lib/net
svc/yp/ypbind
lr-xr-xr-t 1 root 3 21 Aug 1 2001 zoneinfo -> /opt/dce/l
ib/zoneinfo


while another similar 11.0 box here shows what it should:

root@goodbox:/> ls -la /etc | tail
lr-xr-xr-t 1 root sys 19 Jul 6 2000 vtgateway -> /usr/sbin
/vtgateway
lr-xr-xr-t 1 root sys 18 Jul 6 2000 vtserver -> /usr/sbin/
vtserver
drwxr-xr-x 4 bin bin 96 Nov 30 2000 vue
lr-xr-sr-t 1 root sys 14 Jul 6 2000 wall -> /usr/sbin/wall
lr-xr-xr-t 1 root sys 15 Jul 6 2000 whodo -> /usr/sbin/who
do
lrwxrwxrwt 1 root sys 13 Jul 6 2000 wtmp -> /var/adm/wtmp
-rw-r--r-- 1 root root 422 Jan 25 17:44 xtab
lr-xr-xr-t 1 root sys 9 Jul 6 2000 yp -> /usr/sbin
lr-xr--r-T 1 root sys 25 Jul 6 2000 ypbind -> /usr/lib/net
svc/yp/ypbind
lr-xr-xr-t 1 root sys 21 Jul 6 2000 zoneinfo -> /opt/dce/l
ib/zoneinfo

It's gotta be permissions/ownership or the /etc/group file itself, eh?

on badbox the /etc/group file is owned by root:sys while goodbox was bin:bin (both read/read/read permissions). Changing goodbox to have the same settings on /etc/group as badbox didn't cause it to exhibit the problem.

I've looked at the /etc/group file, and don't see any syntax problems (but still, it needs to be something generic to the whole group file or all groups, not just one or two entry in the file.

please help?!!!!
9 REPLIES 9
Deepak Extross
Honored Contributor

Re: "ls -l" showing group id instead of group name...

This would happen if the groups which used to have group IDs 2 and 3 have now been deleted.
Is this the case?
Robin Wakefield
Honored Contributor

Re: "ls -l" showing group id instead of group name...

Hi Kevin,

Any chance you could post the group file, or the first few lines at least, with ID's 2 & 3 (assuming they're there!!).

Rgds, Robin.
Steven Sim Kok Leong
Honored Contributor

Re: "ls -l" showing group id instead of group name...

Hi,

What is the output for:

# grep ':3:' /etc/group
# ll /etc/group

Hope this helps. Regards.

Steven Sim Kok Leong
Deepak Extross
Honored Contributor

Re: "ls -l" showing group id instead of group name...

In the /etc/group file, I mean.
Or it could be that these groups never existed on the machine at all. The files you are listing were created on another machine and transfered here. In such case, as and when you define groups with group IDs 2 and 3, the names you allot to these groups will show up here.
Peter Kloetgen
Esteemed Contributor

Re: "ls -l" showing group id instead of group name...

Hi Kevin,

check out the following:

if you do a chgrp- command for some files/directories to another primary groupname with the same GID, and after this you delete the group with groupdel, you will see this effect! When you do a listing now, you will no longer see the name of the group, but the group identify number.

This works also by the same way with users!


Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Corthouts Carlo
Valued Contributor

Re: "ls -l" showing group id instead of group name...

Hi,

Do you even have a /etc/group
file?

Maybe this file got zero'd out.

Check that first
Kevin_31
Regular Advisor

Re: "ls -l" showing group id instead of group name...

Thanks for the replies so far, and at least I have been spared from doing a "Homer" (Doh!)

Yes the /etc/group file exists, no it's not zeroe'd. Yes the groups 3 and 2 exist (it's all groups, except root which display this problem:

root@badbox:/> grep ":3:" /etc/group
sys::3:root,uucp
root@jensen:/> ls -l /u01/
total 2
drwxrwxrwx 4 acuity 20 1024 Oct 9 2000 acuity
drwxrwxrwx 3 oracle 101 96 Aug 2 2001 app
drwxr-xr-x 2 root root 96 Aug 2 2001 lost+found
root@jensen:/> grep ":101:" /etc/group
dba::101:oracle,root,apa01,sev01,spa01
root@badbox:/>

Attached is the group file.
Kevin_31
Regular Advisor

Re: "ls -l" showing group id instead of group name...

Ahh! found it, a blank line in the /etc/group file.

(Doh!)
Deepak Extross
Honored Contributor

Re: "ls -l" showing group id instead of group name...

Kevin,
Is it my display screen, or do you have spaces/tabs in the file?
From the man page for group:
"No spaces should separate the fields or parts of fields on any line"