2

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.

marked as duplicate by don_crissti, GAD3R, Jeff Schaller, derobert, Kusalananda Jan 30 '17 at 21:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

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.