Linux – How to use diff tool to take a diff between directories with libraries and source

diff()directorylinux

I would like to know if i can use the diff tool to take the difference between two folders which contain sources as well as libraries and executable.

Right now i gave

diff -Naur dir1/ dir2/

It is comparing the executables within the directories and is dumping junk values.
Is there any way to remove the libraries and executable while comparing these directories.

Best Answer

Don't use the -a switch.

diff -Nur dir1/ dir2/

This will only output 'Files dir1/afile and dir2/afile differ' on binary files.

Related Question