How do I delete a single file from a tar.gz archive

后端 未结 5 1986
花落未央
花落未央 2021-02-19 01:58

I have a huge tarbell archive with an excessively large or corrupt error_log that causes the archive to hang when attempting to extract it. Is there a way to remove this from th

5条回答
  •  被撕碎了的回忆
    2021-02-19 02:29

    As mentioned in the comments it's not possible to remove the file using tar, but you can exclude the file when extracting:

    tar -zxvf file.tar.gz --exclude "file_to_exclude"
    

提交回复
热议问题