linux – 当我的文件可能损坏时,如何从这个tar文件中提取?

尝试从tar文件中提取所有文件时,我收到以下错误消息:
tar: Skipping to next header
tar: Error exit delayed from previous errors

在打印此错误消息之前,某些文件会正确提取,并且该过程会生成一个似乎包含其余存档的乱码文件.此存档中的所有文件都是文本文件.

有什么我可以尝试恢复其余的文件?

解决方法

您可以使用-i选项尝试提取以忽略零:
The --ignore-zeros (-i) option causes tar to ignore blocks of zeros in
the archive. Normally a block of zeros indicates the end of the archive,but when reading a damaged archive,or one which was created by cat-ing
several archives together,this option allows tar to read the entire
archive. This option is not on by default because many versions of tar
write garbage after the zeroed blocks.

相关文章

文章浏览阅读1.8k次,点赞63次,收藏54次。Linux下的目录权限...
文章浏览阅读1.6k次,点赞44次,收藏38次。关于Qt的安装、Wi...
本文介绍了使用shell脚本编写一个 Hello
文章浏览阅读1.5k次,点赞37次,收藏43次。【Linux】初识Lin...
文章浏览阅读3k次,点赞34次,收藏156次。Linux超详细笔记,...
文章浏览阅读6.8k次,点赞109次,收藏114次。【Linux】 Open...