I have a question about the diff command if I want a recursive directory diff but only for a specific file type, how to do that?
I tried using the exclude option but can
Taken from ( a version of) the man page:
-x PAT --exclude=PAT
Exclude files that match PAT.
-X FILE --exclude-from=FILE
Exclude files that match any pattern in FILE.
So it looks like -x
only accepts one pattern as you report but if you put all the patterns you want to exclude in a file (presumably one per line) you could use the second flag like so:
$ diff /destination/dir/1 /destination/dir/2 -r -X exclude.pats
where exclude.pats is:
*.jpg
*.JPG
*.xml
*.XML
*.png
*.gif