On Fri, Nov 27, 2009 at 6:19 AM, James Youngman <[email protected]> wrote: > On Wed, Nov 25, 2009 at 3:56 AM, Peng Yu <[email protected]> wrote: >> I want to search for all '.py' files in a directory (recursively). >> However, if there is a '.sh' file in the same directory where a '.py' >> is in, the '.sh' file rather than the '.py' file will be returned. >> Would somebody let me know how to do so? > > Does ... > > find . -name '*.sh' -o -name '*.py' > > ... do what you had in mind?
No. This is not what I want. This will give me all the .sh and .py files. But if there is a .py file and a .sh file with the same suffix in the same directory, I only want to show the .py file but not the .sh file.
