【问题标题】:how to solve TAR: CANNOT MKDIR PERMISSION DENIED如何解决 TAR:不能 MKDIR 权限被拒绝
【发布时间】:2015-08-15 03:23:10
【问题描述】:

文件权限

我有一个文件data.tgz 想要解压缩。

-rw-r--r-- 1 用户名 20342951248 mai 18 11:50 data.tgz


目录权限

文件所在目录

drwxrwxr-x 3 用户名组 4096 juin 1 17:16 目录/


解压缩

当我尝试使用以下命令解压缩文件时:

tar - xzf data.tgz 

我收到以下错误:

tar: data : CANNOT MKDIR PERMISSION DENIED
tar: data/a-m-00004.nt.gz : open impossible: No such file or directory

当我使用tar -xzvf data.tgz 时出现以下错误


错误

tar: data : mkdir impossible: Permission non accordée
tar: data/a-m-00013.nt.gz : open impossible: Aucun fichier ou dossier de ce type
data/a-m-00012.nt.gz
tar: data : mkdir impossible: Permission non accordée
tar: data/a-m-00012.nt.gz : open impossible: Aucun fichier ou dossier de ce type
data/a-m-00015.nt.gz
tar: data : mkdir impossible: Permission non accordée
tar: data/a-m-00015.nt.gz : open impossible: Aucun fichier ou dossier de ce type
data/a-m-00014.nt.gz
tar: data : mkdir impossible: Permission non accordée
tar: data/a-m-00014.nt.gz : open impossible: Aucun fichier ou dossier de ce type
data/a-m-00017.nt.gz
tar: data : mkdir impossible: Permission non accordée
tar: data/a-m-00017.nt.gz : open impossible: Aucun fichier ou dossier de ce type
data/a-m-00016.nt.gz
tar: data : mkdir impossible: Permission non accordée
tar: data/a-m-00016.nt.gz : open impossible: Aucun fichier ou dossier de ce type
data/a-m-00019.nt.gz

谷歌翻译

tar: data: mkdir impossible not granted Permissions
    tar: data / am-00013.nt.gz: Can not open: No such file or folder of this type
    data / a-m-00012.nt.gz
    tar: data: mkdir impossible not granted Permissions
    tar: data / am-00012.nt.gz: Can not open: No such file or folder of this type
    data / a-m-00015.nt.gz
    tar: data: mkdir impossible not granted Permissions
    tar: data / am-00015.nt.gz: Can not open: No such file or folder of this type
    data / a-m-00014.nt.gz
    tar: data: mkdir impossible not granted Permissions
    tar: data / am-00014.nt.gz: Can not open: No such file or folder of this type
    data / a-m-00017.nt.gz
    tar: data: mkdir impossible not granted Permissions
    tar: data / am-00017.nt.gz: Can not open: No such file or folder of this type
    data / a-m-00016.nt.gz
    tar: data: mkdir impossible not granted Permissions
    tar: data / am-00016.nt.gz: Can not open: No such file or folder of this type
    data / a-m-00019.nt.gz

【问题讨论】:

  • 如果在命令中添加 -verbose 标志和 -perserve 权限标志会发生什么? tar - xzfvp data.tgz
  • 我可以不以root身份使用它吗?我不知道
  • 是的,以 root 身份尝试..

标签: permissions tar mkdir


【解决方案1】:

您正在尝试在您没有写入权限的路径中解压缩。尝试运行此命令以提取用户的主目录:tar -xzf data.tgz /home/yourusername

或者尝试使用 sudo 即sudo tar -xzf data.tgz

【讨论】:

  • tar -xzvf data.tgz /home/haniGOTC ==> nothing 它没有在屏幕上产生任何结果
  • 您运行的是什么操作系统?你会 sudo 吗?
  • 不,我实际上不能 sudo。因为我在服务器上运行并使用 Linux kubuntu。我没有提到它,但该文件位于远程服务器上。
  • 您是否尝试将文件从服务器下载到您的机器上?你有这样做的凭据吗?如果是这样,请运行sftp user@host:/path/to/data.tgz ~/some/local/directoryscp user@host:/path/to/data.tgz ~/some/local/directory,然后导航到该目录并尝试提取。您也可以尝试删除连字符,我听说 GNU 使用 tar 可选参数有一些有趣的行为
  • 主目录外部的大多数路径都需要 root 权限才能创建文件夹,这可能是您遇到的问题
猜你喜欢
  • 2016-08-24
  • 2013-07-01
  • 2012-08-13
  • 1970-01-01
  • 2022-07-12
  • 2023-03-22
  • 2018-03-19
相关资源
最近更新 更多