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
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.
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