How to view torrent file content on Linux

Question: I have a torrent file downloaded from the web. Is there a tool that allows me to view the content of a torrent on Linux? For example, I want to know what files are included inside a torrent.

A torrent file (i.e., a file with .torrent extension) is a BitTorrent metadata file which stores information (e.g., tracker URLs, file list, sizes, checksums, creation date) needed by a BitTorrent client to download files shared on BitTorrent peer-to-peer networks. Inside a single torrent file, one or more files can be listed for sharing.

The content of a torrent file is encoded with BEncode, the BitTorrent's data serialization format. Thus to view the content of a torrent file, you need a corresponding decoder.

In fact, any GUI-based BitTorrent client (e.g., Transmission or uTorrent) is equipped with BEncode decoder, so can show to you the content of a torrent file by opening it. However, if you don't want to use any sort of BitTorrent client to check up on a torrent file, you can try a command-line torrent viewer called dumptorrent.

The dumptorrent command prints the detailed content of a torrent file (e.g., file names, sizes, tracker URLs, creation date, info hash, etc.) by using a built-in BEncode decoder.

Install DumpTorrent on Linux

To install dumptorrent on Linux, you can build it from the source.

On Debian, Ubuntu or Linux Mint:

$ sudo apt-get install gcc make
$ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz
$ tar -xvf dumptorrent-1.2.tar.gz
$ cd dumptorrent-1.2
$ make
$ sudo cp dumptorrent /usr/local/bin

On CentOS, Fedora or RHEL:

$ sudo yum install gcc make
$ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz
$ tar -xvf dumptorrent-1.2.tar.gz
$ cd dumptorrent-1.2
$ make
$ sudo cp dumptorrent /usr/local/bin

Make sure that /usr/local/bin is included in your PATH.

View the Content of a Torrent

To check the content of a torrent, simply run dumptorrent with a torrent file as an argument. This will print a summary of a torrent, including file names, sizes and tracker URL.

$ dumptorrent <torrent-file>

To view the full content of a torrent, add "-v" option. This will print more detailed information of a torrent, including info-hash, piece length, creation date, creator, and full announce list.

$ dumptorrent -v <torrent-file>

Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.


Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

4 thoughts on “How to view torrent file content on Linux

  1. How do you then download N individual files?

    Also, your page's pop-up sharing bar slows Chrome *noticeably* on my new LG G3 until it's fully loaded. Using the first button in the toolbar, to the left of the twitter share button, returns an error:

    error on line 13 at column 46: EntityRef: expecting ";"

    I just took Programming Logic and learned BASIC. I've dropped a ";" or two before, myself ☺

  2. This is a very useful but generally unknown small utility program.

    Thank you for bringing it to the attention of the wider GNU/Linux community.

  3. Like your informative website. I've been learning Linux for years, but you come up with stuff we all need to know... Thanks

  4. Do every .torrent file has information on the files contained? I tried running a batch on a group of .torrents but it would only get the files from about %30 of them. Are the files (.mp3, .avi, etc) listed inside the .torrent file on every torrent out there? Thanks in advance

Leave a comment

Your email address will not be published. Required fields are marked *