Tar 错误 [无法打开:不是目录]
我在 Ubuntu 上使用 tar gnome GUI 制作了一些存档文件,但是当我尝试提取它们时,
tar zxvf archive_name
出现以下错误
Cannot open: Not a directory
问题是什么?
I have made some archive file with the tar gnome GUI on Ubuntu but when I try to extract them
tar zxvf archive_name
I get following error
Cannot open: Not a directory
What is the problem ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试将存档解压到空目录中;如果名称重叠,提取目标中的任何现有文件/目录通常会导致问题。
Try extracting the archive in an empty directory; any existing files/directories in the extract target usually cause problems if names overlap.
我遇到了同样的问题(对于存档中的每个文件),我通过将“.tar.gz”附加到存档文件名来解决它,因为我设法下载了一个没有文件扩展名的 PECL 包:
然后我能够发出使用以下命令提取存档的内容:
I encountered the same issue (for each file within an archive) and I solved it by appending ".tar.gz" to the archive filename as I'd managed to download a PECL package without a file extension:
I was then able to issue the following command to extract the contents of the archive:
您可能已经有一个与 tar 正在提取的目录同名的文件。
尝试在不同的位置焦油。
tar zxvf tar_name.tgz --one-top-level=new_directory_name
You probably might already have a file with the same name that the tar is extracting a directory.
Try to tar in different location.
tar zxvf tar_name.tgz --one-top-level=new_directory_name
尝试使用
tar -zxvf archive_name
代替。我相信命令格式已更改,现在需要 z(解压缩)x(提取)v(详细)f(文件名...)部分作为开关而不是纯文本。该错误来自 tar 试图对文件 zxvf 执行某些操作,该文件当然不存在。Try using
tar -zxvf archive_name
instead. I believe that the command format has changed, and it now requires the z (unzip) x (extract) v (verbose) f (filename...) parts as switches instead of plain text. The error comes from tar trying to do something to the file zxvf, which of course does not exist.