Loading... <strong>说明:</strong>很多人肯定以为<code>Aria2</code>只是一个下载工具,需要配合前端比如<code>Aria2 Web UI</code>、<code>AriaNg</code>等使用,其实<code>Aria2</code>本身就是个命令行工具,优点是轻量、开源,支持多协议、多线程,可以直接使用<code>Aria2</code>命令来下载<code>BT</code>种子等资源文件,这里说下<code>Aria2</code>命令使用方法。 <div data-unique="安装"></div> <h2>安装</h2> 执行以下命令: <pre><code class="hljs sql">yum <span class="hljs-keyword">install</span> aria2 #CentOS系统 apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> aria2 #Debian/Ubuntu系统 </code></pre> <div data-unique="使用"></div> <h2>使用</h2> <strong>1、直链下载</strong> 下载直链文件,只需在命令后附加地址,如: <pre><code class="hljs nginx"><span class="hljs-attribute">aria2c</span> http://xx.com/xx </code></pre> 如果需要重命名为<code>yy</code>的话加上<code>--out</code>或者<code>-o</code>参数,如: <pre><code class="hljs nginx"><span class="hljs-attribute">aria2c</span> --out=yy http://xx.com/xx aria2c -o yy http://xx.com/xx </code></pre> 使用<code>aria2</code>的分段和多线程下载功能可以加快文件的下载速度,对于下载大文件时特别有用。<code>-x</code> 分段下载,<code>-s</code> 多线程下载,如: <pre><code class="hljs nginx"><span class="hljs-attribute">aria2c</span> -s <span class="hljs-number">2</span> -x <span class="hljs-number">2</span> http://xx.com/xx </code></pre> 这将使用<code>2</code>个连接和<code>2</code>个线程来下载该文件。 <strong>2、BT下载</strong> 种子和磁力下载: <pre><code class="hljs nginx"><span class="hljs-attribute">aria2c</span> ‘xxx.torrnet‘ aria2c <span class="hljs-string">'磁力链接'</span> </code></pre> 列出种子内容: <pre><code class="hljs css"><span class="hljs-selector-tag">aria2c</span> <span class="hljs-selector-tag">-S</span> <span class="hljs-selector-tag">xxx</span><span class="hljs-selector-class">.torrent</span> </code></pre> 下载种子内编号为<code>1</code>、<code>4</code>、<code>5</code>、<code>6</code>、<code>7</code>的文件,如: <pre><code class="hljs nginx"><span class="hljs-attribute">aria2c</span> --<span class="hljs-literal">select</span>-file=<span class="hljs-number">1</span>,<span class="hljs-number">4</span>-<span class="hljs-number">7</span> xxx.torrent </code></pre> 设置<code>bt</code>端口: <pre><code class="hljs sql">aria2c <span class="hljs-comment">--listen-port=3653 ‘xxx.torrent’</span> </code></pre> <strong>3、限速下载</strong> 单个文件最大下载速度: <pre><code class="hljs nginx"><span class="hljs-attribute">aria2c</span> --max-download-limit=<span class="hljs-number">300K</span> -s10 -x10 <span class="hljs-string">'http://xx.com/xx'</span> </code></pre> 整体下载最大速度: <pre><code class="hljs nginx"><span class="hljs-attribute">aria2c</span> --max-overall-download-limit=<span class="hljs-number">300k</span> -s10 -x10 <span class="hljs-string">'http://xx.com/xx'</span> </code></pre> 这些基本都是常用的几个命令,更多的可以使用<code>man aria2c</code>和<code>aria2c -h</code>查看。 最后修改:2022 年 08 月 02 日 © 允许规范转载 打赏 赞赏作者 赞 0 如果觉得我的文章对你有用,请随意赞赏