Permission changes after extracting tgz file
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
7
down vote
favorite
While extracting a tgz
file, I have noticed that the permission changes to something weird! The tgz file belongs to root:root however, the folder belongs to 502:games
[root@rocks7 common]# ls -l
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
[root@rocks7 common]# tar xf scalapack-2.0.2.tgz
[root@rocks7 common]#
[root@rocks7 common]# ls -l
total 98576
drwxr-xr-x 10 502 games 4096 May 2 2012 scalapack-2.0.2
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
What is the issue here?
centos tar compression
add a comment |Â
up vote
7
down vote
favorite
While extracting a tgz
file, I have noticed that the permission changes to something weird! The tgz file belongs to root:root however, the folder belongs to 502:games
[root@rocks7 common]# ls -l
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
[root@rocks7 common]# tar xf scalapack-2.0.2.tgz
[root@rocks7 common]#
[root@rocks7 common]# ls -l
total 98576
drwxr-xr-x 10 502 games 4096 May 2 2012 scalapack-2.0.2
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
What is the issue here?
centos tar compression
1
consider gnu tar's--no-same-owner
â Jeff Schaller
Jul 19 at 14:44
add a comment |Â
up vote
7
down vote
favorite
up vote
7
down vote
favorite
While extracting a tgz
file, I have noticed that the permission changes to something weird! The tgz file belongs to root:root however, the folder belongs to 502:games
[root@rocks7 common]# ls -l
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
[root@rocks7 common]# tar xf scalapack-2.0.2.tgz
[root@rocks7 common]#
[root@rocks7 common]# ls -l
total 98576
drwxr-xr-x 10 502 games 4096 May 2 2012 scalapack-2.0.2
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
What is the issue here?
centos tar compression
While extracting a tgz
file, I have noticed that the permission changes to something weird! The tgz file belongs to root:root however, the folder belongs to 502:games
[root@rocks7 common]# ls -l
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
[root@rocks7 common]# tar xf scalapack-2.0.2.tgz
[root@rocks7 common]#
[root@rocks7 common]# ls -l
total 98576
drwxr-xr-x 10 502 games 4096 May 2 2012 scalapack-2.0.2
-rw-r--r-- 1 root root 4779534 May 2 2012 scalapack-2.0.2.tgz
What is the issue here?
centos tar compression
edited Jul 19 at 14:22
Anderson
987
987
asked Jul 19 at 12:26
mahmood
291515
291515
1
consider gnu tar's--no-same-owner
â Jeff Schaller
Jul 19 at 14:44
add a comment |Â
1
consider gnu tar's--no-same-owner
â Jeff Schaller
Jul 19 at 14:44
1
1
consider gnu tar's
--no-same-owner
â Jeff Schaller
Jul 19 at 14:44
consider gnu tar's
--no-same-owner
â Jeff Schaller
Jul 19 at 14:44
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
15
down vote
accepted
The tarball contains a scalapack-2.0.2
directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running
tar tvf scalapack-2.0.2.tgz
Tar archives store ownership and permissions in addition to the file contents; since youâÂÂre extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.
Since youâÂÂre running CentOS, youâÂÂre presumably running GNU tar
, and you can use the --no-same-owner
and --no-same-permissions
options to extract tarballs without applying the stored ownership and permissions. Other tar
implementations may have similar options (e.g. -o
on FreeBSD tar
).
POSIXpax
has the (standardized) option-p p
(p
reserve onlyp
ermissions) for that.
â Jörg W Mittag
Jul 19 at 22:57
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
15
down vote
accepted
The tarball contains a scalapack-2.0.2
directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running
tar tvf scalapack-2.0.2.tgz
Tar archives store ownership and permissions in addition to the file contents; since youâÂÂre extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.
Since youâÂÂre running CentOS, youâÂÂre presumably running GNU tar
, and you can use the --no-same-owner
and --no-same-permissions
options to extract tarballs without applying the stored ownership and permissions. Other tar
implementations may have similar options (e.g. -o
on FreeBSD tar
).
POSIXpax
has the (standardized) option-p p
(p
reserve onlyp
ermissions) for that.
â Jörg W Mittag
Jul 19 at 22:57
add a comment |Â
up vote
15
down vote
accepted
The tarball contains a scalapack-2.0.2
directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running
tar tvf scalapack-2.0.2.tgz
Tar archives store ownership and permissions in addition to the file contents; since youâÂÂre extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.
Since youâÂÂre running CentOS, youâÂÂre presumably running GNU tar
, and you can use the --no-same-owner
and --no-same-permissions
options to extract tarballs without applying the stored ownership and permissions. Other tar
implementations may have similar options (e.g. -o
on FreeBSD tar
).
POSIXpax
has the (standardized) option-p p
(p
reserve onlyp
ermissions) for that.
â Jörg W Mittag
Jul 19 at 22:57
add a comment |Â
up vote
15
down vote
accepted
up vote
15
down vote
accepted
The tarball contains a scalapack-2.0.2
directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running
tar tvf scalapack-2.0.2.tgz
Tar archives store ownership and permissions in addition to the file contents; since youâÂÂre extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.
Since youâÂÂre running CentOS, youâÂÂre presumably running GNU tar
, and you can use the --no-same-owner
and --no-same-permissions
options to extract tarballs without applying the stored ownership and permissions. Other tar
implementations may have similar options (e.g. -o
on FreeBSD tar
).
The tarball contains a scalapack-2.0.2
directory owned by user id 502 and whatever group id corresponds to the games group (or, perhaps, the games group by name). You can see this by running
tar tvf scalapack-2.0.2.tgz
Tar archives store ownership and permissions in addition to the file contents; since youâÂÂre extracting as root, that metadata is applied to the extracted files. The ownership of the tarball itself has no impact on the ownership of the extracted data.
Since youâÂÂre running CentOS, youâÂÂre presumably running GNU tar
, and you can use the --no-same-owner
and --no-same-permissions
options to extract tarballs without applying the stored ownership and permissions. Other tar
implementations may have similar options (e.g. -o
on FreeBSD tar
).
edited Jul 19 at 16:04
answered Jul 19 at 12:27
Stephen Kitt
139k22296359
139k22296359
POSIXpax
has the (standardized) option-p p
(p
reserve onlyp
ermissions) for that.
â Jörg W Mittag
Jul 19 at 22:57
add a comment |Â
POSIXpax
has the (standardized) option-p p
(p
reserve onlyp
ermissions) for that.
â Jörg W Mittag
Jul 19 at 22:57
POSIX
pax
has the (standardized) option -p p
(p
reserve only p
ermissions) for that.â Jörg W Mittag
Jul 19 at 22:57
POSIX
pax
has the (standardized) option -p p
(p
reserve only p
ermissions) for that.â Jörg W Mittag
Jul 19 at 22:57
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f457203%2fpermission-changes-after-extracting-tgz-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
consider gnu tar's
--no-same-owner
â Jeff Schaller
Jul 19 at 14:44