wget
-
wget
是一个GNU命令行实用程序,用于从FTP服务器的HTTP、HTTPS下载文件。该命令提供了许多选项,允许用户下载多个文件、恢复下载、限制宽带,镜像网站等。如果想将下载后的文件保存到特定的目录dest,使用-P选型:
mkdir dest wget -P dest/ 链接
如果想限制网速,使用--limit-rate=100k:
wget --limit-rate=100k -P dest/ 链接
如果想要以后恢复中断的文件下载,使用-c选项:
wget -c -P dest/ 链接
如果想要一次下载多个文件,可以使用-i选项和一个包含多个url的文件。
例如,从网上一次下载两个图片:
vim images.txt
vim编辑文件内容为两张图片的url:
https://upload-images.jianshu.io/upload_images/5809200-a99419bb94924e6d.jpg?imageMogr2/auto-orient/strip|imageView2/2/w/1240
https://upload-images.jianshu.io/upload_images/5809200-736bc3917fe92142.jpg?imageMogr2/auto-orient/strip|imageView2/2/w/1240