Post
Share your knowledge.
How to download and extract .tar.zst files without saving?
Hey folks, I'm trying to figure out if there's a way to download a snapshot image as a .tar.zst file and unzip (extract) it while it's downloading. The aim is to avoid saving the .tar.zst file to my hard disk entirely. Any tips on how to achieve this?
- Polygon PoS
Answers
1One approach to achieve downloading and extracting a .tar.zst file in one go is by using a command line pipeline that avoids writing the compressed file to disk. You can try this command as a starting point:
wget -c http://link.tar.zst -O - | tar -I zstd -xf - -C . --strip-components=3
This command uses wget
to download the file and pipes it directly to tar
, which extracts the contents without saving the compressed file first . Keep in mind, if you're dealing with multiple files from Polygon, as mentioned, you'll need to repeat this command for each file you want to download and extract .
Do you know the answer?
Please log in and share it.
Polygon is a decentralised Ethereum scaling platform that enables developers to build scalable user-friendly dApps with low transaction fees without ever sacrificing on security.