How to find and recursively delete all files in Linux

Here's how we delete files with specific extensions in Linux

Locate the files

find . -iname "*.tmp"

find : The command to find files

. : the location to search (dot indicates root)

-iname "*.tmp" : pattern match to find all .tmp files

Now to delete these add the delete command

find . -iname "*.tmp" | xargs rm