今天想下载 MIT 的李代数课程笔记,参见网页:http://math.mit.edu/classes/18.745/Notes/. 突然间忘了 wget
的用法,如果直接将上述 URL 作为 wget
的参数的话,只会下载 index.html 文件。上网搜了一下,发现需要用到以下参数,所以写此日志记录之. 我参考了以下网站http://bmwieczorek.wordpress.com/2008/10/01/wget-recursively-download-all-files-from-certain-directory-listed-by-apache/
基本上,只要:
wget
-r
-np
-nH
-R index.html http:
//url
/including
/files
/you
/want
/to
/download
/
解释一下各个参数的含义:
-
-r
: 遍历所有子目录 -
-np
: 不到上一层子目录去 -
-nH
: 不要将文件保存到主机名文件夹 -
-R index.html
: 不下载 index.html 文件
看,瞬间你要的所有文件就会下载到当前目录了!