How to recursively delete multiple files with different extensions?

bash, delete-file, find, linux

Solution

find . \( -name "*.extension1" -o -name "*.extension2" \) -type f -delete

find Documents ( -name ".py" -o -name ".html" ) -exec file {} \;

OR

find . -regextype posix-egrep -regex ".*\.(extension1|extension2)$" -type f -delete

Problem

I am trying to write a command to remove recursively several files with different extensions (*.extension1, *.extension2 etc) from the current directory and all its related sub-directories. So far I got this command from another post but I couldn't workout how to adapt it to more than one file in the same command line: ``` find . -name "*.extension1" -type f -delete ``` Is it as simple as below? ``` find . -name "*.extension1";"*.extension2" -type f -delete ``` Just as a side note, these are all output files that I do not need, but not all are necessarily always output so some of the extensions might not be present. This is just as a general clean-up command.

Original source