分类: LINUX
2008-05-28 21:48:59
Wget
Wget是一个十分常用命令行下载工具,Wget使用格式如下:
#wget [选项] [下载地址]
Wget常用参数
-b:后台下载,Wget默认的是把文件下载到当前目录。
-O:将文件下载到指定的目录中。
-P:指定保存文件的目录。
-N:don't re-retrieve files unless newer than
-t:尝试连接次数,当Wget无法与服务器建立连接时,尝试连接多少次。
-c:断点续传,如果下载中断,那么连接恢复时会从上次断点开始下载。
此外,Wget还可下载整个 网站,如下载整个Man手册中心。
只需输入如下命令即可: #wget -r -p -np -k 其中-r参数是指使用递归下载,
-p是指下载所有显示完整网页所以需要的文件,如图片等,-np是指不搜索上层目录,-k则是指将绝对链接转换为相对链接。
AXEL
axel的全局配置文件是/etc/axel/axelrc,你可以根据需要对axel进行定制,比如我取消了对alternate_output = 1一行的注释,以便让axel的输出比较简洁一些,你也可以在这个文件中设置axel使用的线程数,默认是4个线程。
使用很简单 axel url即可
限速使用:加上 -s 参数,如 -s 10240,即每秒下载的字节数,这里是 10 Kb
限制连接数:加上 -n 参数,如 -n 5,即打开 5 个连接。
Axel是命令行下的多线程下载工具,支持断点续传,速度通常情况下是Wget的几倍。
下载地址:
下载后使用如下命令编译安装:
#tar zxvf axel-1.0a.tar.gz
#cd axel-1.0a/
#./configure
#make
#make install
基本的用法如下: #axel [选项] [下载目录] [下载地址]
[root@localhost axel-1.0a]# axel --help
Usage: axel [options] url1 [url2] [url...]
-s x Specify maximum speed (bytes per second)
-n x Specify maximum number of connections
-o f Specify local output file
-S [x] Search for mirrors and download from x servers
-N Just don't use any proxy server
-q Leave stdout alone
-v More status information
-a Alternate progress indicator
-h This information
-V Version information
一个典型下载如下: #alex -n 10 -o /home/kennycx/
用10线程将指定路径的文件下载到/home/kennycx/这个目录下
#设置代理[root@localhost axel-1.0a]# export HTTP_PROXY=192.168.0.5:8080
#开始下载[root@localhost axel-1.0a]# axel -n 10 -vo .
initializing download:
File size: 1945089 bytes
Opening output file ./d4x-2.5.6.tar.gz
Starting download
[ 0%] .......... .......... .......... .......... .......... [ 15.3KB/s]
[ 2%] .......... .......... .......... .......... .......... [ 20.5KB/s]
[ 5%] .......... .......... .......... .......... .......... [ 26.3KB/s]
[ 7%] .......... .......... .......... .......... .......... [ 30.1KB/s]
[ 10%] .......... .......... .......... .......... .......... [ 34.0KB/s]
[ 13%] .......... .......... .......... .......... .......... [ 36.7KB/s]
[ 15%] .......... .......... .......... .......... .......... [ 39.0KB/s]
[ 18%] .......... .......... .......... .......... .......... [ 41.7KB/s]
[ 21%] .......... .......... .......... .......... .......... [ 42.7KB/s]
[ 23%] .......... .......... .......... .......... .......... [ 43.2KB/s]
[ 26%] .......... .......... .......... .......... .......... [ 44.6KB/s]
[ 28%] .......... .......... .......... .......... .......... [ 46.6KB/s]
[ 31%] .......... .......... .......... .......... .......... [ 46.6KB/s]
[ 34%] .......... .......... .......... .......... .......... [ 46.2KB/s]
[ 36%] .......... .......... .......... .......... .......... [ 47.5KB/s]
[ 39%] .......... .......... .......... .......... .......... [ 47.3KB/s]
[ 42%] .......... .......... .......... .......... .......... [ 47.9KB/s]
[ 44%] .......... .......... .......... .......... .......... [ 48.0KB/s]
[ 47%] .......... .......... .......... .......... .......... [ 47.2KB/s]
[ 50%] .......... .......... .......... .......... .......... [ 47.6KB/s]
[ 52%] .......... .......... .......... .......... .......... [ 47.2KB/s]
[ 55%] .......... .......... .......... .......... .......... [ 47.5KB/s]
[ 57%] .......... .......... .......... .......... .......... [ 47.8KB/s]
[ 60%] .......... .......... .......... .......... .......... [ 47.6KB/s]
[ 63%] .......... .......... .......... .......... .......... [ 47.8KB/s]
[ 65%] .......... .......... .......... .......... .......... [ 48.0KB/s]
[ 68%] .......... .......... .......... .......... .......... [ 48.0KB/s]
[ 71%] .......... .......... .......... .......... .......... [ 48.3KB/s]
[ 73%] .......... .......... .......... ..........
Connection 1 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, .......
Connection 3 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,... [ 48.1KB/s]
[ 76%] .......... .......... .......... .......... .......... [ 48.2KB/s]
[ 78%] .......... .......... .......... .......... .......... [ 47.9KB/s]
[ 81%] .......... .......... .......... .......... .......... [ 47.8KB/s]
[ 84%] .......... .......
Connection 6 finished
,,,,,,,,,, ,,,,,,,... ..........
Connection 5 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ..........
Connection 2 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, .......... [ 47.1KB/s]
[ 86%] ....
Connection 8 finished
,,,,.....
Connection 4 finished
,,,,,,,,,. .......... .......... .......... .......... [ 43.6KB/s]
[ 89%] .......... .......... .......... .......... .
Connection 9 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,......
Connection 0 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,... [ 40.3KB/s]
[ 92%] .......... .......... .......... .......... .......... [ 35.0KB/s]
[ 94%] .......... .......... .......... .......... .......... [ 27.1KB/s]
[ 97%] .......... .......... .......... .......... .........
Downloaded 1899.5 kilobytes in 1:14 seconds. (25.60 KB/s)