How to see tar content including uid and gid

tar

I have a tar archive and want to see the content with the group-ids and user-ids. When using

tar --list -v --file file.tar

I see the user and group names, but I want to see the user-ids and group-ids instead. How can I achieve this? Or are the users itself stored in a tar archive, and not the ID?s?

Best Answer

When you create a tar archive, the tar utility store the User ID. When you show the content, it looks for the user in /etc/passwd, if it is found print the username, if not print the ID.

To avoid this behaviour try with the --numeric-owner option.