centos多线程下载?手机多线程下载

大家好,关于centos多线程下载很多朋友都还不太明白,不过没关系,因为今天小编就来为大家分享关于手机多线程下载的知识点,相信应该可以解决大家的一些困惑和问题,如果碰巧可以解决您的问题,还望关注下本站哦,希望对各位有所帮助!

linux 多线程下载工具-aria2c

Aria2是一款高效的多线程下载工具,支持 HTTP、FTP、BitTorrent等协议,使用 C++开发,运行速度快。本文将指导您在不同系统上安装并使用 Aria2,同时介绍常用命令和选项。

Ubuntu安装 Aria2

在 Ubuntu上,您需要通过 apt包管理器安装 Aria2。首先,更新软件包列表,执行命令:sudo apt update。然后,输入命令安装 Aria2:sudo apt install aria2。完成安装后,您可以在终端输入 aria2c url来开始下载文件,其中 url为下载链接。

CentOS安装 Aria2

在 CentOS中安装 Aria2相对简单。更新软件包列表,运行命令:sudo yum update。接着,安装 Aria2,输入命令:sudo yum install aria2。遇到依赖关系问题时,安装 EPEL存储库以支持安装,执行命令:sudo yum install epel-release。安装完毕后,使用 aria2c url命令启动下载。

Mac安装 Aria2

Mac用户需要先安装 Homebrew,然后使用 Homebrew安装 Aria2。运行命令:/bin/bash-c"$(curl-fsSL raw.githubusercontent.com...)"来安装 Homebrew。接着,输入命令安装 Aria2:brew install aria2。完成安装后,使用 aria2c url命令下载文件。

Windows安装 Aria2

对于 Windows用户,访问 Aria2官方网站下载 Windows版本,并解压文件到指定位置。安装完成后,在命令提示符中输入 aria2c.exe url开始下载,其中 url是下载链接。

常用命令与选项

Aria2提供多种命令与选项,用于调整下载速度和控制下载进程:

aria2c url:开始下载文件

aria2c-S file.torrent:显示.torrent文件信息

aria2c–stop:停止所有下载

aria2c–pause:暂停所有下载

aria2c–resume:恢复暂停的下载

aria2c–version:显示版本信息

选项包括:

-x n:使用 n个线程下载文件

-s n:下载前等待 n秒

-o filename:指定下载文件名

-d directory:指定下载目录

-c:断点续传

-m n:设置最大下载连接数为 n

–max-download-limit=100K:限制下载速度为 100K/S

通过本文介绍,您现在了解了在不同系统上安装与使用 Aria2的方法,以及一些常用的命令和选项,可快速、高效地完成文件下载任务。

Linux平台安装Aria2多线程下载工具

在Linux平台上,我们可以通过使用P3TERX大佬的增强版一键安装脚本来快速且高效地安装Aria2多线程下载工具。这款脚本不仅提供了官方GitHub地址(github.com/aria2/aria2),还包含了Aria2的完美配置,旨在解决BT下载速度慢、文件残留占用磁盘空间等问题,增强Aria2的性能和用户体验。

安装步骤适用于CentOS 6+、Debian 6+和Ubuntu 14.04+系统,支持x86_64、i386、ARM64和ARM32v7/v6架构。开始安装时,只需输入数字1即可。安装完毕后,可选择修改默认配置,输入数字7进入修改模式,指定下载目录,如"/root/hdusb/downloads"。此外,脚本还提供了方便的命令行操作,如启动、停止、重启和查看状态等,以及配置文件路径"/root/.aria2c/aria2.conf",注意配置文件可能需要调整语言设置以避免中文乱码。默认下载目录为"/root/downloads",但实际下载路径可能根据软件设置有所不同。

Linux下多线程下载工具MWget和Axel使用介绍

linux运维在操作linux过程中,用得最多的linux下载工具想必一定是wget,没有看到哪一台服务器没装过wget的,或许有人使用ftp下载,也有人使用多线程的axel以及ProZilla,毫无疑问这两个工具都非常的出色,但是对于习惯使用wget的人来说显得不适应,于是老外便开发了多线程版本的wget工具mwget,m表示multi多线程的意思.

mwget

官方地址:

代码如下:

# cd/usr/local/src/

# wget

# tar-xjvf mwget_0.1.0.orig.tar.bz2

# cd mwget_0.1.0.orig

#./configure

# make

# make install

configure过程中如果出现如下错误,请安装大于等于0.35版本的intltool

代码如下:

checking for intltool= 0.35.0..../configure: line 6824: intltool-update: command not found

found

configure: error: Your intltool is too old. You need intltool 0.35.0 or later.

# yum install intltool

wget vs mwget速度测试

以下使用下载2.4.5版本的mongodb来取样.

mwget速度测试

代码如下:

# mwget

Begin to download: mongodb-linux-x86_64-2.4.5.tgz

FileSize: 90M

36% [================ ] [ 33M] [2.0M/s] [ETA:00:28]

mwget速度截图如下:

   wget速度测试

代码如下:

# wget

--2013-08-16 10:55:23--

Resolving fastdl.mongodb.org... 54.230.114.206, 54.230.113.36, 54.230.114.144,...

Connecting to fastdl.mongodb.org|54.230.114.206|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 94827295(90M) [application/x-tar]

Saving to:“mongodb-linux-x86_64-2.4.5.tgz.1”

6% [== ] 6,470,547 210K/s eta 6m 26s

wget速度截图如下

   mwget用法:

代码如下:

# mwget-h

GNU MWget 0.1.0,a non-interactive and multiline network retriever of all POSTIX Systems.

Usage: mwget [Options]... [URL]...

Options:

-b,--debug Show the debug message

-c,--count=num Set the retry count to [num], no limit when"0", the default is"99"

-d,--directory=dir Set the local direcotry to [dir], the default is"."

-f,--file=file Rename the file to [file]

-h,--help A brief summary of all the options

-i,--interval=num Set the ftp retry interval to [num] seconds, the default is"5"

-n,--number=num Use [num] connections instead of the default(4)

-r,--referer=URL Include `Referer: [URL]' header in HTTP request.

-t,--timeout=num Set the connection timeout to [num] seconds, the default is"30"

-v,--version Show the version of the mwget and exit

-x,--proxy=URL Set the proxy [URL]

Mail bug reports and suggestions to

On website bug reports and suggestions to

We Welcome your BUG REPORT!

Axel

运维工作中,常常需要下载文件,因为网站下载速度限制或者网络等原因导致下载让人无法忍受,前面有介绍多线程wget工具mwget,提速不少,而且使用很简单。axel使用的人更多,不仅仅安装方法简单,命令更简单。往下看。

安装Axel

RPM安装Axel(方法一)

下载地址:

如图,选择适合你服务器的RPM

   复制代码

代码如下:

root@ttlsa# wget

root@ttlsa# rpm-ivh axel-2.4-1.el6.rf.x86_64.rpm

Preparing...########################################### [100%]

1:axel########################################### [100%]

yum安装Axel(方法二)

复制代码

代码如下:

root@ttlsa# yum install axel

apt-get安装Axel

如果你是Ubuntu系统

代码如下:

root@ttlsa# axel-h

Usage: axel [options] url1 [url2] [url...]

--max-speed=x-s x最大速度(字节/秒)

--num-connections=x-n x最大连接数

--output=f-o f指定文件名

--search[=x]-S [x] Search for mirrors and download from x servers

--header=x-H x添加header

--user-agent=x-U x设置用户代理

--no-proxy-N不使用任何代理

--quiet-q Leave stdout alone

--verbose-v显示更多状态信息

--alternate-a显示简单进度条

--help-h帮助

--version-V版本信息

axel使用实例

下载centos

代码如下:

root@ttlsa# axel

[ 1%].................................................. [4654.5KB/s]

[ 1%].................................................. [4657.1KB/s]

[ 1%].................................................. [4656.5KB/s]

[ 1%].................................................. [4659.3KB/s]

下载运维生存时间某图片

复制代码

代码如下:

root@ttlsa# axel

Initializing download:

File size: 73009 bytes

Opening output file zabbix-adduser-01.jpg

Starting download

proot@ttlsa# axel

Initializing download:

File size: 73009 bytes

Opening output file zabbix-adduser-01.jpg

Starting download

[ 0%].................................................. [ 598.0KB/s]

[ 70%].....................

Connection 0 finished

Downloaded 71.3 kilobytes in 0 seconds.(710.02 KB/s)

简单进度条

默认情况下,整个屏幕都是进度条,加上-a参数,进度条类似wget。

复制代码

代码如下:

root@ttlsa# axel-a

Initializing download:

File size: 4467982336 bytes

Opening output file CentOS-6.5-x86_64-bin-DVD1.iso

Starting download

p[ 1%] [0 1 2 3 ] [ 3.2MB/s] [21:47]

下载限速

ttlsa的网站带宽有限制,我要保证下载的同时又不影响用户的访问,例如限制为1MB/s的下载速度,如下可以看到速度基本保证在1MB以内。

复制代码

代码如下:

root@ttlsa# axel-s 1024000

Initializing download:

File size: 4467982336 bytes

Opening output file CentOS-6.5-x86_64-bin-DVD1.iso

State file found: 30522952 bytes downloaded, 4437459384 to go.

Starting download

,,,,,,,........................................... [ 394.8KB/s]

[ 0%].................................................. [ 689.2KB/s]

[ 0%].................................................. [ 879.5KB/s]

[ 0%].................................................. [ 974.5KB/s]

[ 0%].................................................. [1086.4KB/s]

[ 0%].................................................. [ 967.5KB/s]

[ 0%].................................................. [ 943.8KB/s]

[ 0%].................................................. [1021.0KB/s]

[ 0%].................................................. [1066.1KB/s]

最后

完成,方法很简单,功能很简单。运维生存时间的服务器以及安装了axel,你的安装了吗?

阅读剩余
THE END