Changing ownership of files with an obsolete UID/GID
If you have changed or removed a UID or GID, you must
change the ownership of their files and check your filesystems for
orphaned files. Files without a real owner have a number in the
owner and/or group name fields:
-rw-r--r-- 1 obie pub 68476 Nov 16 12:06 accts.s -rw-r--r-- 1 15625 pub 508 Oct 31 11:15 balance -rw-r--r-- 1 obie pub 40596 Aug 31 13:19 report.2In this example, the file balance is an orphaned file. The number appears because files are stamped with the ID number rather than the user or group name.
utility to locate and change the ownership of files.
This command line finds all files on the system owned by user
UID and changes ownership to user newowner:
find / -user UID -print | xargs -t chown newowner
This variation changes the group ownership:
find / -user GID -print | xargs -t chgrp newgroup
Instead of changing the ownership, you can perform other actions, such as archiving the files; see ``Locating files''.