如何使用wget下载整个目录和子目录?
我正尝试使用wget
下载该项目的文件,因为该项目的SVN服务器不再运行,并且只能通过浏览器访问这些文件.所有文件的基本URL都与
I am trying to download the files for a project using wget
, as the SVN server for that project isn't running anymore and I am only able to access the files through a browser. The base URLs for all the files is the same like
http://abc.tamu.edu/projects /tzivi/repository/revisions/2/raw/tzivi/ *
如何使用wget
(或任何其他类似的工具)下载此存储库中的所有文件,其中"tzivi"文件夹是根文件夹,并且有多个文件和子文件夹(最多2个或3个)级别)?
How can I use wget
(or any other similar tool) to download all the files in this repository, where the "tzivi" folder is the root folder and there are several files and sub-folders (upto 2 or 3 levels) under it?
您可以在shell中使用它:
You may use this in 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
如果您不想下载全部内容,则可以使用:
If you don't want to download the entire content, you may use:
-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
.
And so on. If you insert no -l
option, wget
will use -l 5
automatically.
如果插入-l 0
,则将下载整个Internet,因为wget
会跟踪找到的每个链接.
If you insert a -l 0
you´ll download the whole Internet, because wget
will follow every link it finds.