Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-18-2014, 07:36 AM   #1
Registered: Feb 2009
Location: Bangalore
Posts: 61

Rep: Reputation: 15
File owner

I have a tar file. This was copied to my system as root.The ls -l on the tar file shows the owner as root. When I untarred it and did ls -l, instead of root I see
a number for the files that are unatarred. I was expecting the owner for the files
untarred to be root.

Old 08-18-2014, 07:45 AM   #2
Senior Member
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian, Arch
Posts: 1,163
Blog Entries: 7

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
In short, the user with the UID (user ID) who created your tar file doesn't exit on your system.

The user ID is the third column.

Suppose I were to create a .tar file containing files created originally by "user1", and give you that file. Now you extract that file, but you have no user with the same user id (9001). As a result, the files will show in a listing as owned by user id "9001" and not a name.

You can fix this with chown, as root (group is optional):

chown -R

Last edited by goumba; 08-18-2014 at 07:48 AM. Reason: Spelling corrections
Old 08-18-2014, 09:39 AM   #3
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 3,620

Rep: Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577
When you extract from a tar file as "root", the default is to preserve the permissions and ownership as stored in the archive. You would need to use the "--no-same-owner" option to ignore the saved ownership and leave all files and directories owned by the current user (root).

Last edited by rknichols; 08-18-2014 at 09:40 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Owner of a directory different than file owner problems Guardian-Mage Linux - Server 4 04-24-2009 11:26 AM
Display by File Name, File Size, and File Owner using ls akeenabawa Linux - Newbie 9 08-15-2008 03:21 PM
File owner and File group locked - root deiphage Linux - Hardware 5 02-05-2005 02:30 PM
file permissions and file owner won't change Nadim Slackware 5 11-29-2003 07:03 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration