Meld

Filtering out files

When you compare folders, you may want to be able to ignore some files. For example, you may wish to only see files that are present and different in both folders, ignoring those that are the same or only exist in one folder. Alternatively, you might want to ignore all the files in your .git directory, or ignore all images.

Meld has several different ways of controlling which files and what kind of differences you see. You can filter based on differences between a file across folders or file and folder names. You can also tell Meld to treat filenames as being case insensitive. Finally, you can use text filters to change what both folder and file comparisons see.

Any text filters you've defined automatically apply when comparing folders. Files that are identical after all of the text filters are applied are not highlighted as being different, but are shown in italics.

File differences filtering

In a folder comparison, each line contains a single file or folder that is present in at least one of the folders being compared. Each of these lines is classified as being either Modified, New or Same:

Modified

The file exists in multiple folders, but the files are different

New

The file exists in one folder but not in the others

Same

The file exists in all folders, and is the same everywhere

You can change which types of differences you see in your current comparison by using the Same, New and Modified buttons on the toolbar or the View ▸ File Status menu.

Currently, you can only filter files based on their state; folders can't be filtered in this way. For example, you can't tell Meld to ignore all folders that contain only new files. A folder containing only "New" files would show up as empty, but still present.

Filename filtering

Meld comes with a useful set of filename filters that let you ignore uninteresting files and folders like common backup files and the metadata folders of version control systems. Each filename filter can be separately activated or deactivated from the Filters button on the toolbar or the View ▸ File Filters menu.

You can add, remove or change filename filters from the File Filters section of the Preferences dialog. Filename filters specify patterns of filenames that will not be looked at when performing a folder comparison. Any file that matches an active filter won't even show up in the tree comparison. Filename filters match both files and folders; if a folder matches a filter, it and all of its contents are ignored.

Filename filters match according to shell glob patterns. For example, *.jpg will match all filenames ending in .jpg. The following table lists all of the shell glob characters that Meld recognises.

Shell glob patterns

Wildcard

Matches

*

anything (i.e., zero or more characters)

?

exactly one character

[abc]

any one of the listed characters

[!abc]

anything except one of the listed characters

{cat,dog}

either "cat" or "dog"

Changing a filter's Active setting in the Preferences dialog changes whether that filter is active by default.

Activating a filter from the menu or the toolbar turns the filter on or off for this comparison only.

Case insensitive filenames

Files are compared across directories according to their name. This comparison is case sensitive by default; that is, the files README, readme and ReadMe would all be seen as different files.

When comparing folders on some filesystems (e.g., HFS+ or FAT) you may wish to make Meld treat filenames as case insensitive. You can do this by selecting View ▸ Ignore filename case from the menus.