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 wanted to remove the jdk directory from the elasticsearch-oss archive with a one liner, and this is what I came up with:
gzip -d elasticsearch-oss-7.10.1-linux-x86_64.tar.gz -c | tar --delete --wildcards */jdk | gzip - > /tmp/tmp.$$.tar.gz && mv /tmp/tmp.$$.tar.gz elasticsearch-oss-7.10.1-linux-x86_64.tar.gz
I further refined this to include the download:
curl -Ss https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.10.1-linux-x86_64.tar.gz | gzip -d - -c | tar --delete --wildcards */jdk | gzip - > elasticsearch-oss-7.10.1-linux-x86_64.tar.gz
Works a treat on ubuntu 20.04, so gnu tar which does not support the @ sign.