command-line7zip

7zip: How to exclude files larger than 100mb?


Is there a way in 7zip command line to zip folder but exclude all large files (greater than 100mb) recursively under it?


Solution

  • If there are only a few files that are that big, you could write a distinctive marker like _no7_ in their filename and use the command line version of 7zip including the switch -xr!*_no7_* to exclude them from archiving. Or you can set up a list of things to exclude, e.g. filenames, and tell 7zip to use that list to determine what to exclude. That's what I ended up doing.