'Download specific folder from tar.gz file using wget command
I'd like to download and extract specific folder from tar.gz, which is stored on cloud space. right now what i am following is
wget --auth-no-challenge --no-check-certificate --user=myuser --password=mypass <URL>
tar -xvf <Folder>tar.gz
now, i only want a specific repo from that extracted Folder.
Folder
|-- Repo1
|-- Repo2
Problem:
- Space Constraint as the tar.gz is around 8GB.
- Time taken to download the Tar.
so minimize time and solve space issue i want to partially download specific repo from tar.
i tried
wget --auth-no-challenge --no-check-certificate --user=myuser --password=mypass <URL> | tar -xvf Folder/Repo1
which obviously does not work. I am trying to play with it, but couldn't succeed.
any suggestion are appreciated. Thanks in advance :)
Solution 1:[1]
The command should be something like:
wget --auth-no-challenge --no-check-certificate --user=myuser --password=mypass -O /dev/stdout <URL> | tar -xvf - Folder/Repo1/*
- you need to set where to "download" file (
-O) - you need to tell tar what is the input file (
tar -xvf -) - You may need to add wild card to the path
P.S. Nevetheless you will download entire file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Romeo Ninov |
