Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use BitTorrent to download from the command line of Linux

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "how to use BitTorrent to download on the command line of Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to download using BitTorrent on the command line of Linux.

If you like to try the latest version or even the beta version of the Linux distribution to satisfy your curiosity and keep it up-to-date, then you will often have trouble downloading larger ISO images. People who provide ISO usually use .torrent files mirrored by ISO to reduce bandwidth consumption on the server. P2P downloads also have obvious benefits for users (in terms of download speed), especially when a new version of the popular Linux distribution is released and uploaded for download, and everyone is downloading and planting at the same time.

Ubuntu 14.10 (utopic Unicorn) has just been released, so there should be many seeds available for download on the BitTorrent network. Although there are many graphical interface-based BitTorrent clients, I will show you how to download ISO images from a BitTorrent client based on a simple command-line interface, which is convenient if you are on a remote server without a graphical interface.

The command-line-based BitTorrent client I'm going to use today is transmission-cli. As you probably know, Transmission is one of the most popular graphical interface-based BitTorrent clients. Transmission-cli is its command-line version in plain form.

Install Transmission-cli on Linux

To install transmission-cli, you don't have to install a full graphical interface-based Transmission, which sounds good.

On Debian, Ubuntu, or distributions based on them:

The code is as follows:

$sudo apt-get install transmission-cli

On Fedora:

The code is as follows:

$sudo yum install transmission-cli

On CentOS or RHEL (after installing the EPEL repository):

The code is as follows:

$sudo yum install transmission-cli

Quickly download ISO images through transmission-cli

The use of transmission-cli is very simple. If you are too lazy to learn its command-line options, all you have to do is download the .torrent file and run the command. This automatically looks for available seeds and downloads the ISO file from there.

The code is as follows:

$wget http://releases.ubuntu.com/14.10/ubuntu-14.10-desktop-amd64.iso.torrent

$transmission-cli ubuntu-14.10-desktop-amd64.iso.torrent

Once the ISO image is downloaded, it is stored in the ~ / Downloads folder by default. It only took me 5 minutes to download the Ubuntu ISO image of 1GB.

After downloading the ISO image, you will see the prompt "status changed from unfinished to complete" in the terminal. Note that transmission-cli will continue to run and seed so that other downloaders can download it. You can press Ctrl+C to exit.

Customize download options for reuse

If you use transmission-cli a lot, it's worth taking the time to familiarize yourself with its command-line options.

The "- w / path/to/download-directory" option specifies the folder where the download file is saved.

The "- f / path/to/finish-script" option sets the script to run after the current download is complete. Note that transmission-cli continues to run by default after the file has been downloaded. You can use this option if you want to turn off transmission-cli automatically after a successful download. The following simple script can do this.

The code is as follows:

#! / bin/sh

Sleep 10

Killall transmission-cli

If you want to allocate upload / download bandwidth limits for transmission-cli, you can use the "- d" and "- u" options. If you don't want to limit bandwidth usage, just specify the "D" or "- U" options.

Here is a more advanced example of using transmission-cli. In this example, the command line client automatically exits after a successful download. Download speed is unlimited while upload speed is limited to 50KB/s.

The code is as follows:

$transmission-cli-w / iso-D-u 50-f / finish.sh ubuntu-14.10-desktop-amd64.iso.torrent

At this point, I believe you have a deeper understanding of "how to download with BitTorrent on the command line of Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 219

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report