Assuming the files are sorted, you can use
Here I'm wondering if any objc files in the current directory also exist in the Classes subdirectory% ls -1 *.[hm] *.xib | sort > oopack % cd Classes % ls -1 *.[hm] *.xib | sort > ../oop2 % cd .. % comm -12 oopack oop2The
-12suppresses lines only in file1, and lines only in file2. I'm more interested in their intersection.