regex - 如何使用 wget 下载整个目录和子目录?

我正在尝试使用 wget 下载项目的文件,因为该项目的 SVN 服务器不再运行,我只能通过浏览器访问这些文件。所有文件的基本 URL 都相同,如

http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/*

如何使用 wget(或任何其他类似工具)下载此存储库中的所有文件,其中“tzivi”文件夹是根文件夹,并且有多个文件和子文件夹(最多2或3级)在它下面?

最佳答案

你可以在 shell 中使用它:

wget -r --no-parent http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/

参数是:

-r     //recursive Download

--no-parent // Don´t download something from the parent directory

如果您不想下载全部内容,可以使用:

-l1 just download the directory (tzivi in your case)

-l2 download the directory and all level 1 subfolders ('tzivi/something' but not 'tivizi/somthing/foo')  

等等。如果不插入 -l 选项,wget 将自动使用 -l 5

如果您插入 -l 0,您将下载整个 Internet,因为 wget 将跟随它找到的每个链接。

https://stackoverflow.com/questions/17282915/

相关文章:

python - 获取列表的内容并将其附加到另一个列表

python - 只读取文件的第一行?

python - 如何在不破坏默认行为的情况下覆盖 __getattr__?

python - Python 是否优化尾递归?

python - 获取文件的最后n行,类似于tail

linux - 我什么时候应该在 shell 变量周围加上引号?

linux - 省略任何 Linux 命令输出的第一行

c - Linux中的itoa函数在哪里?

linux - 如何重定向已运行进程的输出

mysql - 如何测试MySQL在哪个端口上运行以及是否可以连接?