3

When I view properties of a file, the file owner appears as ‘user # 1004’. Why doesn’t it show the user name? I tried asking at #ubuntu but nobody answered.

3 Answers3

2

The file system itself only stores the numeric user and group ID for a file, it does not store the names. The name comes from the running system's /etc/passwd and /etc/group.

If you mount the same filesystem on another system, that numeric ID might not correspond to the same user or group name. Or, it may not correspond to any user or group, in which case it will appear only by its number, no matter where you view it.

Another situation in which this may occur is if you have deleted the user or group since the file's ownership information was set.

thomasrutter
  • 36,774
1

The user with the ID 1004 doesn't exists (anymore) in your system.

You can check this with

grep ':1004' /etc/passwd

If there is no output, the user with the ID 1004 doesn't exist.


You can take the ownership with this command

sudo chown $USER:$USER file
kos
  • 35,891
A.B.
  • 90,397
0

The reasons this happens is because the owner member of that group was deleted by you or was deleted. This user previously had permissions to the said folder. However, since the user doesn't exist anymore, the permissions for owner show the id but not the name as a remnant metadata.

You can just type id into your terminal and it will give you all the groups available with their owners.

CoderX
  • 161