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

Lily avatar
By Lily
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

--
Tags: Linux

All Comments

Emma avatar
By Emma
at 2008-10-21T07:57
這個帥
Kristin avatar
By Kristin
at 2008-10-24T02:02
真不錯 ^^ 又學一招
Andrew avatar
By Andrew
at 2008-10-26T20:43
又學到了一招
Rae avatar
By Rae
at 2008-10-28T13:03
推~~學到了
Joe avatar
By Joe
at 2008-10-28T22:55
還要裝curl

wget有批次下載的功能嗎

Ophelia avatar
By Ophelia
at 2008-10-17T14:55
#!/usr/bin/ruby for i in 1..30 fn=sprintf(and#34;http://ftp.encntc.edu.tw/Study/CH%02d.pptand#34;,i) system(and#34;wget -c #{fn}and#34;) end 這樣可以嗎? ※ ...

wget有批次下載的功能嗎

Kristin avatar
By Kristin
at 2008-10-17T14:09
※ 引述《copnew (newcop)》之銘言: : 可是實際上wget 並不支援萬用字元 : 導致我必須連續執行30次wget的指令才可以下載到所有我想要的檔案 : 推 kira925:還有其他可以選阿,像aria跟curl 10/17 13:28 : → ...

wget有批次下載的功能嗎

Gilbert avatar
By Gilbert
at 2008-10-17T13:23
http://ftp.encntc.edu.tw/Study 上面這個網站有一些我想要的PPT資料 假如說我要抓的資料網址為 http://ftp.encntc.edu.tw/Study/CH01.ppt ........................ http://ftp.encntc.edu.tw/S ...

Vmware workstation 灌linux

Olivia avatar
By Olivia
at 2008-10-17T13:12
※ 引述《jimmyoic (jimmyoic)》之銘言: : 我安裝的是 Fedora 9 : 安裝完畢後 選擇鍵盤語言跟時區密碼等 : 可是到分割磁區那邊按下一步會顯示 系統找不到可分割的磁碟機 : 然後就不能繼續了 : 請問一下問題出在哪atat : 謝 我猜想你是用SCSI模式 用IDE吧, 我用的 ...

ubuntu的檔案瀏覽器

Audriana avatar
By Audriana
at 2008-10-17T11:12
剛剛我要打開檔案瀏覽器 就卡很久 然後消失 又出現 又消失 任何檔案跟資料夾都顯示不出來 reboot之後還是一樣耶 囧 有沒有人遇到過這種情形阿?? 感恩.... - ...