开发者

Tar Error [can not open: not a directory]

开发者 https://www.devze.com 2022-12-28 18:22 出处:网络
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 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 follo开发者_运维问答wing error

Cannot open: Not a directory

What is the problem ?


Try extracting the archive in an empty directory; any existing files/directories in the extract target usually cause problems if names overlap.


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:

mv pecl_http pecl_http.tar.gz

I was then able to issue the following command to extract the contents of the archive:

tar -xzf pecl_http.tar.gz


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号