linux中wget命令的使用方法

2019-04-15  本文已影响0人  建康_木子
wget工具体积小,功能完善,支持断点下载,支持FTP和HTTP下载方式,支持代理服务器,设置方便简单。
下载单个文件:
wget http://www.baidu.com/example.zip 
下载多个文件:
首先,保存一份下载链接文件 
cat > filelist.txt 
url1 
url2 
url3 
url4 
接着使用这个文件和参数-i下载 
wget -i filelist.txt 
重命名下载的文件:
wget -O test.zip http://www.baidu.com/example.zip  
限速下载
wget –limit-rate=300k http://www.baidu.com/example.zip 
断点续传:
wget -c http://www.baidu.com/example.zip 
后台下载:
wget -b http://www.baidu.com/example.zip 
>Continuing in background, pid 23400. 
>Output will be written to `wget-log’. 
可以通过命令tail -f wget-log查看下载进度
查看下载连接是否正确:
wget –spider URL 
如果下载链接正确,将会显示 :
wget –spider URL 
Spider mode enabled. Check if remote file exists. 
HTTP request sent, awaiting response… 200 OK 
Length: unspecified [text/html] 
Remote file exists and could contain further links, 
but recursion is disabled — not retrieving. 
如果下载链接错误,将会显示 :
wget –spider url 
Spider mode enabled. Check if remote file exists. 
HTTP request sent, awaiting response… 404 Not Found 
Remote file does not exist — broken link!!! 
上一篇 下一篇

猜你喜欢

热点阅读