Compare two directories excluding files with a name matching a specified pattern

diffoscope

diffoscope --exclude {{pattern}} {{path/to/directory1}} {{path/to/directory2}}

click the source code to copy install diffoscope on any operating system with command-not-found.com