tar命令在提取时更改owner:group [英] tar command changing the owner:group while extracting

查看:69
本文介绍了tar命令在提取时更改owner:group的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用此命令提取文件 tar -zxf bluez-arm-package.tgz 文件和目录的owner(1000):group(pulse)是如下例所示.

While extracting a file using this command tar -zxf bluez-arm-package.tgz the owner(1000):group(pulse) of the files and directories is changing as below example.

示例:

drwxrwxr-x    4 1000     pulse         1024 Jul 21 00:32 dbus-1 

实际应为:

drwxrwxr-x    4 root     root          1024 Jul 21 00:32 dbus-1

推荐答案

tar中有一个用于输出流的选项:-no-same-owner

There is an option for output stream in tar : --no-same-owner

所以

tar xvf test_tar.tar --no-same-owner

可能会以拥有者身份启动此命令的用户创建文件.有点奇怪,因为普通(非超级用户)用户应默认使用此选项(--no-same-owner).

will probably create files with user who launch this command as owner. It's a little bit strange as this option (--no-same-owner) should be default for ordinary (non-superuser) users.

它对您有用吗?

这篇关于tar命令在提取时更改owner:group的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆