Results 1 to 4 of 4
Believe me, I've looked, but I can't find an answer to this anywhere quickly...
I have tarballs which have the wrong permissions and owners/groups embedded.
When I extract the files, ...
- 08-05-2009 #1Just Joined!
- Join Date
- Dec 2008
- Posts
- 19
Tar help with permissions
Believe me, I've looked, but I can't find an answer to this anywhere quickly...
I have tarballs which have the wrong permissions and owners/groups embedded.
When I extract the files, I want to blanket apply a particular user, group, and permissions to files and directories.
Is there a way to do this?
I have tried
tar --owner=newowner --group=newgroup --mode=ugo=rwX -xf archive.tar
but it just extracts the files ignoring any changes to permissions.
Steve
- 08-05-2009 #2
Does the user running the tar command have write access to the files?
Linux User #453176
- 08-05-2009 #3Just Joined!
- Join Date
- Dec 2008
- Posts
- 19
Yes, it's me

I'm taring up a pile of files off my mac, which obviously has nothing in common in terms of users/groups with my linux web server.
Obviously the ID's associated with my mac account user/group are nonsense once the file is unpacked on the linux box.
Does that make sense?
- 08-05-2009 #4
I'm not sure if this is causing the error must normally Linux commands have a space after a flag rather than an = sign (not always, for example dd doesn't)
You could try:
Your mode may be okay but I have never used that method before. I assume you replace newowner and newgroup with ones that exist on your system too?Code:tar --owner newowner --group newgroup --mode 744 -xf archive.tar
Last edited by Kieren; 08-05-2009 at 02:50 PM. Reason: formatting and typo
Linux User #453176


Reply With Quote
