How do I achieve find . -name "*.py" in finder

How do I achieve this in finder ?

call_center ➤ find . -name "*.py"
./cr-web/vendor/mockery/mockery/docs/conf.py
./wsssip/build.py
...

I had thought it should be as simple as following, but it is not!

finder find


The asterisk is not a glob in Finder/Spotlight search.

Try the search without the asterisk: type .py then choose ‘Name matches: .py’ from the dropdown.

However, searching for file extensions is not the usual way to use Spotlight search, and you can't pin the filename search to the end of the filename using Finder. Instead, Spotlight can understand what a Python source file is, so you can search for python and choose ‘Python Source’ for more accurate searches.


You can also search by file extension in Spotlight. You'll usually find those criteria stashed away under "Other" (that also includes searching for system files).

enter image description here