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
I did that in tree steps. Hopefully will help others in the future.
gzip -d file.tar.gz
tar -f file.tar --delete folder1/file1.txt --delete folder2/file2.txt
gzip -9 file.tar
If you have multiple files use this. But the archives them must have all the files you want to delete, or tar will give a error.
for f in *.tar.gz
do
echo "Processing file $f"
gzip -d "$f"
tar -f "${f%.*}" --delete folder1/file1.txt --delete folder2/file2.txt
gzip -9 "${f%.*}"
done