场景: Linux 系统中需要 从网上直接下载安装 软件
命令格式:
wget [参数] [URL地址]
示例:
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin" -O jdk-6u45-linux-x64.bin
Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F
http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-i586.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.rpm
http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-windows-i586.exe
http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-windows-x64.exe
2、使用wget -i下载多个文件
首先,保存一份下载链接文件 test.txt
http://www.baidu.com/a.jpg
http://www.baidu.com/b.jpg
http://www.baidu.com/c.jpg
然后执行wget -b -i test.txt 即可
3、使用wget –limit -rate限速下载
wget --limit-rate=300k http://download.redis.io/releases/redis-2.8.13.tar.gz