Linux Bash – How to Find and Delete Multiple Files

bashlinux

I have directories with sub directories containing .srt files. I need to go through the directories and delete them all. I know how to find them like so:

find ./directory -name *.srt

but I'm not sure how to pipe them to rm.

Best Answer

The syntax is a little bit tricky:

find ./directory -name "*.srt" -exec rm {}  \;
Related Question