There is a feature of the WinRAR (for Windows) archiver I love a lot: it can be set up to skip trying to compress particular files (based on their extension (name pattern)) while including them into a compressed archive. When it comes to backing up a user home directory it saves tons of time to give up trying to compress mp3, jpg, zip, etc. files and just add them to a (non-solid) archive untouched while compressing text, xls, database etc. files being added.

Having switched to Linux I still strongly prefer non-solid compressing archivers (like zip and 7z, I mostly use 7z I have switched to even before switching to Linux) over traditional tar.gz for my own convenience reasons (tar.gz advocates use to say it is needed to save rights/ownership information and links but I don't use any in my non-system files).

But I miss the WinRAR's feature to skip specific files compression a lot. May you happen to be a 7z fan too, maybe you know the way to achieve the effect?


2 Answers 2


Normally this is done using tar but if you really want to skip compression set the compression level to 0.

Since I don't have the GUI and actually I don't use it you may have to write a script to do what you need for example I use PERL but you can do it any way you choose. This particular one will skip the jpg files.

my $archive = "/home/user/archive.zip";
for $file @filenames
    my $compression_level = 9;
    $compression_level = 0 if($file =~ /jpg$/);
    `7za a -tzip -mx=$compression_level $archive $file`;

You can probably get as sophisticated as you want with scripts but that's up to you.


I was just looking for the same and I realize this is an old question, but I think I've found a way.

Add the files to (i.e. update) the archive separately.

So for example first we add all the text files with best compression:

7z a archive.7z "*/*.txt" -mx9

Then update with all the mp3 files without compression:

7z u archive.7z "*/*.mp3" -m0=copy

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.