unp
A wrapper that works out which extractor an archive needs and calls it.
What it does
unp looks at a file, picks the right tool — tar, unzip, 7z, unrar, gunzip, bunzip2, xz, cabextract and so on — and runs it with sensible flags. One command instead of remembering which of tar xzf, tar xjf or tar xJf this particular tarball wants.
unp archive.tar.zst
unp *.zip # several at once
unp -U messy.zip # unpack into a subdirectoryNotes
A Perl script from Debian, so it depends on the extractors actually being installed — it dispatches, it does not decompress. With p7zip and rar present it covers essentially everything.
Alternative to
| Alternative | Type | Trade-off |
|---|---|---|
| dtrx | Open source | The same idea, with safer extraction into a subdirectory by default |
| atool | Open source | Another dispatcher, with more format coverage |
tar xf | Built in | Modern tar detects compression on its own, which covers most cases |
Install
brew install unp