1

As you know by default there is one program (command) for each compression format and unfortunately, some of them use a different command for data extraction.

I would like to memorize a single app that supports common compression/archiving formats with a single unified command syntax. What is your suggested program?

  • write a shell script that uses file to detect file type and then run appropriate file type specific utility.... – ivanivan Jun 24 '18 at 15:12
  • I'm not using any such programm, but at least in Ubuntu/Mint I can find atool, dtrx, patoolapt-cache search is your friend on those systems :) – Izzy Jun 24 '18 at 17:19
  • @Izzy The main concern of the question is cmd. If you have to memorise a command better to learn the most versatile tool. – PHPst Jun 26 '18 at 13:18
  • Thanks, @PHPst – I've fixed my above comment. Did you take a look at the 3 tools I've mentioned? – Izzy Jun 26 '18 at 13:34
4

There's no way to support all compression formats. Because not every format is known publicly, and even within famous formats like zip and rar there are variants that may not be known or supported2 (have you ever heard of *.zipx)? It's produced by winzip but rarely any other tools can open it). Moreover some formats don't allow you to embed in other tools1

But if you just want to be able to work with most common file formats then 7z and it's p7zip Linux counterpart are probably the best solutions. It's not commonly used in Linux land like on Windows, but it does support a single syntax for all formats: 7z a to compress and 7z x to decompress

However of course it has some quirks like mentioned above

  • 1 7z can decompress most common file types including *.rar but it can't compress into rar because of licensing reasons

  • 2 It doesn't support all zip and rar formats

Why can't 7-Zip open some ZIP archives?

In 99% of these cases it means that the archive contains incorrect headers. Other ZIP programs can open some archives with incorrect headers, since these programs just ignore errors.

If you have such archive, please don't call the 7-Zip developers about it. Instead try to find the program that was used to create the archive and inform the developers of that program that their software is not ZIP-compatible.

There are also some ZIP archives that were encoded with methods unsupported by 7-Zip, for example, WAVPack (WinZip).

Why can't 7-Zip open some RAR archives?

7-Zip 9.20 supports RAR 2/3/4 formats only and doesn't support RAR5 archives. But latest versions of 7-Zip supports RAR5 archives.

https://www.7-zip.org/faq.html

An important note: 7-zip does not store the owner/group of the file so you have to pass through tar first if you really need to store those information.


Winrar is also a good solution, which supports RAR, ZIP, CAB, ARJ, LZH, TAR, GZ, BZ2, ACE, UUE, JAR, ISO, 7Z, XZ, Z. Unfortunately previously the command prompt version was free, but now it has also become trial software. If you can live with the "infinite" trial period it's also worth a try


But 7z and winrar are not the compression softwares that support the most formats. According to Wikipedia with a list of 19 formats we have the following top softwares with their supported formats

Of course the above list is not absolutely correct, because there are a lot more formats which are not included. Most archivers support significantly more than those 19 format. For example PeaZip "supports 188 file extensions (as of version 6.0.0)", and BulkZip claims to support these formats:

  • Compression: Bulk, 7z, Arc, Nz, Pja, Tar, Zip, Zpaq
  • Extraction: 7z, Ace, Bulk, Apk, Arc, Arj, Bz2, Ear, Cab, Cb7, Cba, Cbr, Cbt, Cbz, Chm, Cramfs, Dmg, Gz, Img, Ipa, Iso, Jar, Lha, Lzh, Lzma, Nz, Pja, Rar, Rar5, Tar, Tbz, Tgz, Txz, Uha, Uue, War, Wim, Xz, Z, Zip, Zipx, Zpaq

Note that extension and format are different. Some extensions can contain various formats

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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