Suppose my directory structure looks like
A--file1.cpp
file2.cpp
file3.cpp
file1.h
file2.h
file3.h
B--file1.cpp
file2.cpp
file3.cpp
file1.h
file2.h
file3.h
and my goal is to find every cpp file besides file1.cpp in the A folder
find A/ B/ -name \*.cpp will find all the files, and I tried find A/ B/ ! -name file1.cpp -name \*.cpp this will exclude file1.cpp from the B folder as well. find A/ B/ -prune -o file1.cpp -name \*.cpp doesn't work either. What is the correct way to do it?