wget有批次下載的功能嗎 - Linux

By Lily
at 2008-10-17T16:04
at 2008-10-17T16:04
Table of Contents
※ 引述《itucson (愛吐桑)》之銘言:
: #!/usr/bin/ruby
: for i in 1..30
: fn=sprintf("http://ftp.encntc.edu.tw/Study/CH%02d.ppt",i)
: system("wget -c #{fn}")
: end
: 這樣可以嗎?
: ※ 引述《copnew (newcop)》之銘言:
: : http://ftp.encntc.edu.tw/Study
: : 上面這個網站有一些我想要的PPT資料
: : 假如說我要抓的資料網址為 http://ftp.encntc.edu.tw/Study/CH01.ppt
: : ........................ http://ftp.encntc.edu.tw/Study/CH30.ppt
: : 我試著用以下指令 wget -c http://ftp.encntc.edu.tw/Study/CH0[1-9].ppt
: : wget -c http://ftp.encntc.edu.tw/Study/CH1[0-9].ppt
: : wget -c http://ftp.encntc.edu.tw/Study/CH2[0-9].ppt
: : wget -c http://ftp.encntc.edu.tw/Study/CH30.ppt
: : 可是實際上wget 並不支援萬用字元
: : 導致我必須連續執行30次wget的指令才可以下載到所有我想要的檔案
: : 現在檔案我下載完了
: : 但還是很想知道有沒有甚麼方法可以加速我的工作效率
: : 謝謝
其實不需要這麼麻煩,還動到 shell script,只要用 curl 一行就解決了
curl -O 'http://ftp.encntc.edu.tw/Study/CH[01-30].ppt'
用 [01-30] 會自動把個位數補 0,也就是 01, 02, 03... 30
如果不需要補 0 的話就用 [1-30] 就會變成 1, 2, 3... 30
--
: #!/usr/bin/ruby
: for i in 1..30
: fn=sprintf("http://ftp.encntc.edu.tw/Study/CH%02d.ppt",i)
: system("wget -c #{fn}")
: end
: 這樣可以嗎?
: ※ 引述《copnew (newcop)》之銘言:
: : http://ftp.encntc.edu.tw/Study
: : 上面這個網站有一些我想要的PPT資料
: : 假如說我要抓的資料網址為 http://ftp.encntc.edu.tw/Study/CH01.ppt
: : ........................ http://ftp.encntc.edu.tw/Study/CH30.ppt
: : 我試著用以下指令 wget -c http://ftp.encntc.edu.tw/Study/CH0[1-9].ppt
: : wget -c http://ftp.encntc.edu.tw/Study/CH1[0-9].ppt
: : wget -c http://ftp.encntc.edu.tw/Study/CH2[0-9].ppt
: : wget -c http://ftp.encntc.edu.tw/Study/CH30.ppt
: : 可是實際上wget 並不支援萬用字元
: : 導致我必須連續執行30次wget的指令才可以下載到所有我想要的檔案
: : 現在檔案我下載完了
: : 但還是很想知道有沒有甚麼方法可以加速我的工作效率
: : 謝謝
其實不需要這麼麻煩,還動到 shell script,只要用 curl 一行就解決了
curl -O 'http://ftp.encntc.edu.tw/Study/CH[01-30].ppt'
用 [01-30] 會自動把個位數補 0,也就是 01, 02, 03... 30
如果不需要補 0 的話就用 [1-30] 就會變成 1, 2, 3... 30
--
Tags:
Linux
All Comments

By Emma
at 2008-10-21T07:57
at 2008-10-21T07:57

By Kristin
at 2008-10-24T02:02
at 2008-10-24T02:02

By Andrew
at 2008-10-26T20:43
at 2008-10-26T20:43

By Rae
at 2008-10-28T13:03
at 2008-10-28T13:03

By Joe
at 2008-10-28T22:55
at 2008-10-28T22:55
Related Posts
wget有批次下載的功能嗎

By Ophelia
at 2008-10-17T14:55
at 2008-10-17T14:55
wget有批次下載的功能嗎

By Kristin
at 2008-10-17T14:09
at 2008-10-17T14:09
wget有批次下載的功能嗎

By Gilbert
at 2008-10-17T13:23
at 2008-10-17T13:23
Vmware workstation 灌linux

By Olivia
at 2008-10-17T13:12
at 2008-10-17T13:12
ubuntu的檔案瀏覽器

By Audriana
at 2008-10-17T11:12
at 2008-10-17T11:12