Extracting the contents of a (possibly compressed) archive file is a task I need to perform very often.

Depending on what method of compression and archive format the author of an archive file chose, I need to use one of the tar, unzip, gunzip, xz, or 7z commands (and there are probably others I haven't encountered, or that I have encountered but I can't think of right now), each with a slightly different command-line syntax.

It would be nice to have a single command that can handle all of these formats. Is there one?

Note that I don't necessarily expect a single tool to know about and handle all of the formats. I'd be perfectly happy with a tool that just provides a uniform interface, and plugins/connectors that provide support for the various formats.


Short of writing your own wrapper script to 1) detect the archive type and then 2) use the appropriate command to extract it, a quick apt-cache search extract came up with dtrx that seems to do exactly what you're asking for.

  • dtrx is indeed exactly what I was looking for. Much thanks! – HighCommander4 Feb 1 '17 at 7:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.