Finding all files with a certain extension in Linux?

find /tmp -name "*.py"

The example above uses the find command to search files in the tmp folder for Python files that have the extension .py.

To get a list of all the files with the same extension inside the current directory, look for all the Python extension files for this example.

find . -type f -name "*.py"

In the above example, the. Denotes the current directory. find Searches recursively in all the directories below the given path

I'm Feeling Lucky
Darryl Dias

Written by Darryl Dias

The AI guy and founder of Caprycon, building AI-powered tools, exploring emerging technologies, and sharing insights from the world of artificial intelligence