Support >
  About independent server >
  Method of using dtrx command in Linux
Method of using dtrx command in Linux
Time : 2024-11-18 14:17:02
Edit : Jtti

Using the dtrx command in Linux simplifies the extraction of multiple types of archive files. Here are the steps for installing and using dtrx.

Install dtrx on Debian-based systems (e.g. Ubuntu, Debian, Linux Mint) :

sudo apt-get install dtrx

For Red Hat-based systems (e.g. RHEL, CentOS, Fedora), dtrx may not be in the default repository and needs to be installed from source code:

Wget HTTP: / / https://github.com/dtrx-py/dtrx/releases/download/8.5.3/dtrx-8.5.3.tar.gz

tar -xvf dtrx-8.5.3.tar.gz

cd dtrx-8.5.3

sudo python3 setup.py install --prefix=/usr/local

Use the dtrx command to extract a single archive file, such as a file named example.tar.gz:

dtrx example.tar.gz

dtrx automatically extracts content to a dedicated directory named after the archive file name and maintains file permissions.

If it is a file containing multiple archives, such as all.zip, which contains file1.zip, file2.zip, etc., you can extract all the nested zip files directly with dtrx:

dtrx all.zip

dtrx will recursively extract all zip files into their respective folders.

When dtrx detects that the archive contains other archives, it will prompt you to select an action:

a recursively extracts all the contained archive files. o Extract only the contained archive files. N Do not extract the contained archive files, only the source archive. v Do not extract the contained archive files in this session. l Lists all the contained archives.

What types of compressed files can the dtrx command handle? Common ones are tar, zip, coip, rpm, ded, gem, 7z, rar, gz, bz2, lzma, xz, cab, lzh, exe. dtrx uses a unified command to process these different formats of compressed files, so that users do not need to memorize a variety of different commands and options, greatly simplifying the extraction of compressed files.

In linux, you can use other command decompression tools besides dtrx. For example, tar can be used to decompress.tar,.tar.gz,.tar.bz2,.tar.xz, and other formats:

tar -xvf filename.tar.gz

gzip can be used to decompress.gz files:

gzip -d filename.gz

gunzip is also used to handle files in.gz format and is a link to gzip:

gunzip filename.gz

bzip2 is used to handle files in.bz2 format:

bzip2 -d filename.bz2

unzip is used to process files in.zip format:

unzip filename.zip

7z supports 7z, zip, gzip, bzip2, tar, gzip and other formats.

7z x filename.7z

rar is used to handle files in.rar format:

unrar x filename.rar

xz is used to process.xz or.lzma format files:

xz -d filename.xz

zip is used to create and decompress.zip files:

zip -d filename.zip

cabextract for processing Microsoft Cabinet files (.cab)

cabextract filename.cab

rpm2cpio is used in conjunction with the cpio command to extract files from the.rpm package.

rpm2cpio filename.rpm | cpio -idmv

ar is used to handle static library files such as.a and.lib:

ar x filename.a

With these steps, you can easily use the dtrx command on a Linux system to extract and manage archive files in different formats.

JTTI-Defl
JTTI-COCO
JTTI-Selina
JTTI-Ellis
JTTI-Eom