Dtrx: A Versatile Tool for Extracting Archives on Linux (tar, zip, rpm, and more)

watch 2m, 34s
views 2

09:17, 27.04.2026

Article Content
arrow

  • Introduction to Dtrx
  • Key Features of Dtrx
  • Installing Dtrx on Linux
  • Using the dtrx Command on Linux
  • 1. Unpacking a Single Archive
  • 2. Handling Multiple Archives at Once
  • 3. Selecting a Specific Archive to Extract
  • 4. Unpacking Nested Archives
  • 5. Extracting Metadata from .deb, .rpm, and .gem Files
  • 6. Extracting Files into a Separate Directory
  • 7. Viewing Supported Archive Formats

Introduction to Dtrx

When working on Linux, managing archives such as .tar, .zip, .rpm, and others is a frequent task. While tools like tar and unzip can handle specific formats, switching between utilities for different archive types can be difficult. Enter dtrx (Do the Right Extraction), a versatile command-line utility designed to simplify archive extraction on Linux. It smartly handles various archive formats, automatically creating directories, managing nested archives, and ensuring proper permissions.

This article explores the features of dtrx, its installation process, and practical examples of how to use it effectively.

Key Features of Dtrx

  • Supports Multiple Archive Formats: Handles formats like .tar, .zip, .rpm, .deb, .gem, and more.
  • Metadata Extraction:Allows you to view metadata from .deb, .rpm, and .gem packages without full extraction.
  • Automatic Directory Creation: Extracts files into a new directory named after the archive, avoiding clutter.
  • Nested Archive Handling: Recursively unpacks archives contained within another archive.
  • User-Friendly: Automates many manual extraction tasks while providing granular options for advanced users.

Installing Dtrx on Linux

In Ubuntu-based distributions dtrx tool is included by default; in this case, you can use the following command to install it:

sudo apt install dtrx
  • For Fedora use: sudo dnf install dtrx
  • For Arch Linux, use the AUR package: yay -S dtrx
  • For other distributions, you can install it via pip: pip install dtrx

Using the dtrx Command on Linux

Once installed, dtrx simplifies archive extraction with its intelligent features. Let’s explore its capabilities through practical examples.

1. Unpacking a Single Archive

Extracting a single archive is as simple as using the dtrx command followed by an archive name. For example:

dtrx file.tar.gz
This creates a directory named file and extracts the archive contents.

2. Handling Multiple Archives at Once

If you have a file that consists of multiple archives, instead of extracting each of them manually, you can extract all of them at once by using the “a” option that performs a recursive extraction:

dtrx dtrAll.zip

You can additionally verify the contents of the extracted directory by using the Is command:

cd dtrAll ls

3. Selecting a Specific Archive to Extract

If you need to extract the main archive and not the nested archives, use the following command:

dtrx dtrAll.zip

4. Unpacking Nested Archives

Say you want to extract a specific layer of archives, a second one, and not the third, you can use the “o” option.

For example, you have “dtrNewAll.zip“, which consists of “dtrAll.zip” and “dtrNew“. If you want to extract the “dtrNewAll” and “dtrAll” but not those archives down the hierarchy, you can use:

dtrx dtrNewAll.zip

5. Extracting Metadata from .deb, .rpm, and .gem Files

To extract metadata, use the “m” option:

dtrx -m openfire_4.9.0_all.deb dtrx -m openfire-4.9.0-1.noarch.rpm dtrx -m openfire-4.9.0.gem

6. Extracting Files into a Separate Directory

Specify a custom directory for extraction with:

dtrx -d custom_directory archive.tar.gz

7. Viewing Supported Archive Formats

To see all formats supported by dtrx, run:

dtrx --help

Dtrx is a powerful utility for Linux users who often work with various archive formats. Its intelligent handling of different scenarios, from nested archives to metadata extraction, makes it a valuable addition to your command-line toolkit.

Share

Was this article helpful to you?

VPS popular offers

-9.9%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
40 GB HDD
Bandwidth
Bandwidth
300 Gb
KVM-HDD HK 1024 Linux

4.94 /mo

/mo

Billed annually

-20.5%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
8 TB
KVM-SSD 8192 Metered Linux

57 /mo

/mo

Billed annually

-9.5%

CPU
CPU
8 Epyc Cores
RAM
RAM
32 GB
Space
Space
200 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 32768 Windows

74.49 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Epyc Cores
RAM
RAM
4 GB
Space
Space
50 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 4096 Linux

16.68 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
8 GB
Space
Space
100 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 8192 Linux

26.72 /mo

/mo

Billed annually

-8%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
200 GB HDD
Bandwidth
Bandwidth
300 Gb
wKVM-HDD HK 8192 Windows

25.78 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
8 GB
Space
Space
100 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 8192 Linux

26.35 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
16 GB
Space
Space
150 GB NVMe
Bandwidth
Bandwidth
Unlimited
Keitaro KVM 16384
OS
CentOS
Software
Software
Keitaro

55.54 /mo

/mo

Billed annually

-9.2%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
Unlimited
10Ge-wKVM-SSD 4096 Windows

72 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
Unlimited
wKVM-SSD 4096 Windows

18.65 /mo

/mo

Billed annually

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.