Home Downloads How to download Torrents using the command-line in Terminal

How to download Torrents using the command-line in Terminal

by Pulkit Chandak
Published: Updated:
download torrents using command-line

Using torrents is a great and efficient way of file sharing. It provides useful features like the ability to pause downloads, setting upload/download speed limits, and managing multiple downloads efficiently. And since downloading a torrent is based on the availability of its seeders, it’s more common in an interactive community, like that of FOSS.

Download Torrents using Command-line

In this article of Terminal Tuts, we’re going to show you how to download Torrents using the command-line via the Terminal interface. We will use a program called rTorrent. There are many others, but most of them were created because of the existence of their GUI first. rTorrent is independent and only CLI based.

rTorrent Features

1. Terminal is the UI

Being a CLI program, we would expect the content to be organized well, and rTorrent exactly does that. Categorization of items is clear, and that’s all one need to use the program.

rtorrent UI

Running window of rTorrent

2. Minimum CPU and maximum bandwidth

rTorrent is light on the system resources as it is a text-based program. It fetches the maximum data transfer speeds! Therefore, when compared to a GUI based torrent program, you will undoubtedly notice a considerable increase in system performance and data speeds.

3. Torrent information

Users can view the details of the torrents opened in rTorrent similar to any GUI torrent client. Information such as the size of the files, the amount downloaded, the upload/download speed, remaining time and a few more details are displayed.

Torrent info

Running torrent.

Further, users can check information like source, filename, size, active time, number of files, memory usage and even details like the number of chunks.

Options are available to view the peer list, file list, tracker list, transfer list and the chunks seen.

These can be accessed by simply selecting a torrent and pressing the Right Arrow key.

Torrent details

Torrent details.

Installation

rTorrent is available in most major distributions’ repositories. For Ubuntu, Linux Mint or any derivatives, type:

sudo apt-get install rtorrent
rT install

Installation on Linux Mint

For other distributions, you can either search in your distribution’s repositories or download the .tar.gz package from here.

After downloading the package, run the following commands (assuming it’s in the Downloads directory):

cd Downloads/
tar -xzvf rtorrent*.tar.gz
cd rtorrent<Tab>

(Press the tab key after writing rtorrent. Terminal will complete rest of the name.)

./configure; make; sudo make install

And that’s it. For more information on installation, visit this site.

Usage

rTorrent is a great program, especially if you know the keyboard commands and shortcuts. So, we’ll be showing some of the everyday actions that you’ll require to manage your torrents.

Starting up rTorrent

Starting it up is easy. Just fire up a terminal, and write:

rtorrent

rTorrent will cover up the whole terminal screen.

rT opening

Opening window.

Adding torrents

There are two options to add torrents. First, you can use a downloaded torrent file or the URL of the torrent file. Both have the same method.

After starting rTorrent, press Enter, and you’ll get this:

rT enter(ed)

After pressing Enter.

Now after this ‘load.normal>’ part, enter the location, or the URL of the file. By default, the working directory of this program is the home directory. So say if you want to select a torrent from the Downloads directory, enter Downloads, and DON’T press Enter. You have to enter the whole filename of the torrent file, so press the Tab key. That will list all the files in the window.

rT-tab

Listing contents of a directory.

Complete the filename, and press Enter. The torrent will appear in the window.

Alternatively, press Enter after starting rTorrent and copy-paste the URL of the torrent file.

rT location of torrent

Entering the location of the torrent.

rT URL

Entering URL of the torrent.

The torrent will not start downloading by default. It would begin automatically if you press Backspace instead of entering to input the location of the torrent file. We intentionally did this, because if you enter it that way, you don’t get the option to change the destination directory of the torrent download. So that’s the next part.

Changing the destination directory

Now that the torrent is added press the upper arrow key to select it. When it is selected, three asterisks (*) will appear to the torrent’s left.

rT selected torrent

Selecting a torrent.

Now enter CTRL + O. This will show a prompt of change_directory, and now you can enter the desired destination directory.

Don’t worry; you won’t have to do this every time. We will show the automation of this at the end of the article.

Starting download

Now to start the download of the torrent, simply select it (using upper arrow) and press CTRL + S. The download will begin.

Stopping and removing the torrent download

Stopping and removing the use of the same command. To stop/pause a download, select it and press CTRL + D. After stopping it once, the status will show Inactive. To remove it, press the same combination one more time.

Viewing more information

To see more information, you simply have to select the torrent and press the Right Arrow key. I have described before in this article what information will show up.

Changing priorities

Changing priorities is simple. All you have to do is select the torrent, and press ‘+’ if you want to set it to a high priority level, and ‘-‘, if you want to set it to a low priority level. (NOTE: The ‘+’ and ‘-‘ of the number-pad don’t work. Use the ones on the left of backspace~). The priority will show up on the right side.

rT-priority

Torrent priority displayed.

You can also change the priorities of files of a specific torrent, after going in the ‘File list’ sub-section of the information menu (the one that comes up after pressing Right Arrow key).

Viewing options

There exists an option to view files by their status. Some are listed:

  • 0: Show active
  • 1: Show all
  • 2: Show all; ordered by name
  • 3: Show started
  • 4: Show stopped
  • 5: Show completed

Exiting

To exit rTorrent, press CTRL + Q.

Configuration file

It is optional but highly recommended. rTorrent does have certain disadvantages, but you can work around them. We will create a configuration file for rTorrent that will have all the needed details.

First, create the file using:

nano rtorrent.rc

We will first change the default destination from home directory to wherever we want. We will use a directory named rtorrent for example (make sure to create a directory of that name). Enter this:

 directory=~/rtorrent/

(‘~’ symbol signifies home directory.)

Next, to auto-resume incomplete downloads on starting rTorrent, you will have to add the location of the directory in which the torrent files are located. Typically, it’s the Downloads directory.

load_start=~/Downloads/*.torrent

So the file looks like this:

Now save it by pressing CTRL + X, and then type ‘y’ and press Enter.

Conclusion

We have explained everything in detail so that you can change and use the options available as much as you’d like. For even more commands and options, visit this site. rTorrent is an excellent program for the highest productivity, and we hope you have fun using it!

Let us know about your views in the comment section.

You may also like

1 comment

x0r0x May 2, 2021 - 7:06 AM

Hello, I’ve just release very convenient utility for the same purpose, check it out:
https://github.com/X0R0X/cli-torrent-dl

Reply

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.