简体   繁体   English

使用 wget 命令从 tar.gz 文件下载特定文件夹

[英]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.我想从存储在云空间中的 tar.gz 下载并提取特定文件夹。 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 |-- 回购1

|-- Repo2 |-- 回购2

Problem:问题:

  1. Space Constraint as the tar.gz is around 8GB.空间限制,因为 tar.gz 大约为 8GB。
  2. Time taken to download the Tar.下载 Tar 所花费的时间。

so minimize time and solve space issue i want to partially download specific repo from tar.所以尽量减少时间并解决空间问题我想从 tar 部分下载特定的 repo。

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:)提前致谢:)

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/*
  1. you need to set where to "download" file ( -O )您需要设置“下载”文件的位置( -O
  2. you need to tell tar what is the input file ( tar -xvf - )你需要告诉 tar 输入文件是什么 ( tar -xvf - )
  3. You may need to add wild card to the path您可能需要在路径中添加通配符

PS Nevetheless you will download entire file. PS 尽管如此,您还是会下载整个文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM