On several of our CentOS 5 systems, the /etc/group file was munged by an automated script.
As a result, there are some files on the system which have an undefined GID-- the GID is not defined in /etc/group
. For example, the following file is owned by GID 103, when it should be owned by the group 'mysql'.
# ls -ld /var/lib/mysql/mysql/user.frm
-rw-rw---- 1 mysql 103 10330 Apr 1 02:47 /var/lib/mysql/mysql/user.frm
Is there a way for me to find ALL files on this system which are owned by undefined groups?
I know I can do something like this to find all files owned by GID 103:
find / -gid 103
However, I want to find ALL files which are owned by an undefined group.