Skip to content
WindowsLinux

Rules

Match files by extension and regular expression, set priorities and import or export your rule set.

Public release: Mouzi v0.1.6. Features planned for a later version are labelled on the page.

A rule combines an extension condition, an optional regular expression and a destination. Mouzi checks enabled rules from the lowest priority number to the highest and uses the first match.

Rules are global. The same list is applied to every watched folder.

Extension matching

Enter extensions without a leading dot. Separate several values with commas:

Extensions: pdf, docx, odt
Destination: Documents

Extension matching is case-insensitive, so Report.PDF matches pdf. The special value * matches any extension and is useful as a final catch-all rule.

Mouzi 0.1.6 also inspects recognizable files without a filename extension. PNG, JPEG, PDF, ZIP and other formats reported by their file signature use that detected type when matching rules. PE, ELF and Mach-O executables are routed through the existing exe rule category. The filename itself is not changed merely because a type was detected.

File-name patterns

The optional Pattern field is a Rust regular expression matched against the complete file name, including its extension. There is no separate plain-text “contains” mode.

Extensions: png, jpg
Pattern: ^Screenshot.*\.(png|jpg)$
Destination: Images/Screenshots/{year}

Patterns are case-sensitive unless you add (?i):

(?i)^invoice[-_ ].*\.pdf$

When both extensions and a pattern are present, both must match. An invalid regular expression will not match files, so test a new rule in Manual mode first.

Priority and first match

Lower numbers run first. Set the numeric Priority field rather than relying on the visual position of a row.

Priority Match Destination
10 pdf and (?i)invoice Documents/Invoices
20 pdf Documents/PDF
999 * Other

An invoice reaches the first rule and stops there. Other PDFs reach the second rule. Everything else can fall through to the catch-all.

Enable and disable

Use the switch on a rule row to pause or resume it without opening the editor. Disabled rules remain in the database and keep their configuration.

Destinations and conflicts

Relative destinations such as Documents/PDF are created inside the source watched folder. Absolute paths such as D:\Archive or /mnt/archive are also supported, including moves to another drive.

The folder button beside Destination stores a relative path when you pick a folder inside the watched folder and an absolute path when you pick one elsewhere.

Mouzi creates missing destination folders. If a file with the same name already exists, it keeps the existing file and adds a Unix timestamp to the file being moved.

See dynamic paths for destination placeholders.

Rule actions and the system Trash

The usual action moves a file to its destination. The remove action sends it to the operating system Recycle Bin or Trash; Mouzi no longer permanently deletes it. Restoration for this action is handled by the operating system and is not offered by Mouzi’s History view.

Extension normalization

Enable Normalize file extensions on a move rule to rename equivalent suffixes while moving. Mappings use source:target, separated by commas, semicolons or lines:

jpeg:jpg, tiff:tif

Only the final filename suffix is changed. Mouzi validates the target extension and still applies its normal collision protection.

Custom notifications

A rule can provide its own notification text. Use {file}, {rule} and {destination} placeholders, for example:

Dangerous file moved by Mouzi: {file}

Import and export

Use Settings → Rules to export all rules as JSON. Import can either append rules or replace the current set. Keep an export before using the replace option; replacing is intentional and cannot be undone from History.

Starter rules

The first run includes categories for images, documents, archives, installers, music and videos, followed by an * catch-all. You can edit or delete every starter rule.

Edit this page on GitHub
Was this page helpful?