Filtering Files

A BetterZip filter is a saved set of rules that matches files by name, path, kind, size, or modification date – the same kind of structured query Finder uses for Smart Folders. Once a filter exists, you can use it three ways: to delete matching items from an open archive, to skip items while writing a new archive, and to skip items while extracting.

Where filters live

Filters are managed centrally on the Filtering tab in Settings. Each filter has a list of criteria and a name you can refer to from presets or invoke manually. Built-in filters cover common cases – Mac-specific files, version-control folders, backup files – and you can add your own.

Filter criteria

A filter is a list of rules grouped under Any of, All of, or None of. Each rule matches one of:

  • Name, Path, Kind: text comparisons with is, contains, begins with, ends with, is like (shell-style glob with * and ?), or matches regex.
  • Size: numeric comparisons in bytes, KB, MB, or GB.
  • Date Modified: an absolute date or a relative window (within the last N days/weeks/months/years).

The full list of operators and attributes is on the Settings – Filtering page.

Delete with Filter

Use this to strip unwanted items out of an open archive: .DS_Store files, ._ resource forks, Thumbs.db, .svn or .git directories, build artifacts – whatever a filter matches. Trigger it any of these ways:

  • Hold Option while clicking the Delete button in the toolbar.
  • Click and hold the Delete toolbar button, then pick Delete with Filter or one of your saved filters from the drop-down.
  • Choose Edit > Delete with Filter.

The sheet titled Delete Files From Archive shows the rule builder at the top and a live preview of matching items below it. As you tweak rules, the preview updates immediately so you can see exactly which files will be removed before you commit. A menu at the bottom lets you load a saved filter as a starting point or save the current rules as a new named filter. Click Delete to remove the matches, Cancel to back out.

One-click cleanups

The Delete toolbar button’s drop-down also has two ready-made cleanups that don’t need a filter:

  • Delete Mac Files: strips .DS_Store, resource forks, and ._ AppleDouble files. Going forward, BetterZip will also keep those files out when you add new items to this archive, so the cleanup sticks across edits.
  • Delete Empty Folders: does just that.

Filtering on save and extract

To apply a filter automatically while creating or extracting archives, set Exclude items matching on the relevant save preset or extract preset. BetterZip applies the filter as it writes or unpacks, so matching items never make it into the destination.