I have a directory holding several files having the suffix “.orig” which I would like to compare to those not having that suffix
Again, the find utility will be of great use. The following command sequence (all on one line) will compare the files:
for file in `find . -name "*.orig"` ; do diff $file "`dirname $file`/`basename $file .orig`" ; done
This is Bourne shell (sh
or bash
) syntax; have a look at the csh manpage to find out how to construct a for-loop in the C shell.