Linux常用下載工具--wget

普通下載

普通下載

wget http://example.com/file.iso

指定保存文件名

wget ‐‐output-document=myname.iso http://example.com/file.iso

保存到指定目錄

wget ‐‐directory-prefix=folder/subfolder http://example.com/file.iso

大文件斷點續傳

wget ‐‐continue http://example.com/big.file.iso

下載最新版本

wget ‐‐continue ‐‐timestamping http://wordpress.org/latest.zip

下載指定文件中的url列表

wget ‐‐input list-of-file-urls.txt

下載指定數字列表的多個文件

wget http://example.com/images/{1..20}.jpg

下載web頁面的所有資源

wget ‐‐page-requisites ‐‐span-hosts ‐‐convert-links ‐‐adjust-extension http://example.com/dir/file

下載整個網站

下載所有lian接的頁面和文件

wget ‐‐execute robots=off ‐‐recursive ‐‐no-parent ‐‐continue ‐‐no-clobber http://example.com/

下載指定後綴的文件

wget ‐‐level=1 ‐‐recursive ‐‐no-parent ‐‐accept mp3,MP3 http://example.com/mp3/

下載指定目錄的所有圖片

wget ‐‐directory-prefix=files/pictures ‐‐no-directories ‐‐recursive ‐‐no-clobber ‐‐accept jpg,gif,png,jpeghttp://example.com/images/

下載多個域名下的pdf文件

wget ‐‐mirror ‐‐domains=abc.com,files.abc.com,docs.abc.com ‐‐accept=pdf http://abc.com/

排除指定目錄下載

wget ‐‐recursive ‐‐no-clobber ‐‐no-parent ‐‐exclude-directories /forums,/support http://example.com

繞過限制下載

指定user-agent

wget ‐‐refer=http://google.com ‐‐user-agent=”Mozilla/5.0 Firefox/4.0.1″ http://baidu.com

指定用戶名密碼

wget ‐‐http-user=labnol ‐‐http-password=hello123 http://example.com/secret/file.zip

post帳號密碼並保存cookie

wget ‐‐cookies=on ‐‐save-cookies cookies.txt ‐‐keep-session-cookies ‐‐post-data 'user=labnol&password=123'http://example.com/login.php

使用cookie下載文件

wget ‐‐cookies=on ‐‐load-cookies cookies.txt ‐‐keep-session-cookies http://example.com/paywall
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章