File has different owner if examined using `sudo`

finderpermissionsudoterminal

I have some files backed up on an external HD, and according to Finder they're all owned by my standard user account. According to Terminal, however, they're owned "unknown" if I look at them using sudo. If I don't use sudo they agree with Finder. I still seem to have normal access to them, but can anyone tell me what's going on here?

Best Answer

These files are owned by UID 99, which is the unknown user. These files were, perhaps, initially created by an account that is no longer on the system, or a "different version of yourself" that was migrated from a previous version of the OS, etc. To avoid confusion, when a normal user inspects these files, they appear to belong to whoever is viewing them. When root inspects them (via sudo, for example), their actual owner is shown.

The following describes this in greater detail:

http://googlemac.blogspot.com/2007/03/user-99-unknown.html