I want to find all files (in current and all subdirectory) which end in'~' or 'pyc'. To do so I have tried the following find pattern:find . -name '*{~,pyc}'find . -name '{*~,*.pyc}'but neither list any of the files present in the diectory. Why do these patterns not work? How to do it right?When using ls instead of find (without the quotation mark) I get the expected result (except that ls only shows the current directory and not all the subdirectories).
How to find files ending with ~ and pyc?
find;wildcards;patterns
It would be much easier with regular expression if you have the GNU find,find . -regextype posix-egrep -regex '.*(~|pyc)$'P.S I guess you're using shell expansion with find? If so, that's not possible, use find . -name '*.pyc' -o -name '*~' instead.