Dave Perrett

Delete Files by Extension

linux, programming, quickie

To recursively delete all files with a given extension (eg all .pyc files in a django application), use :

1
find . -name "*.pyc" -exec rm '{}' ';'

Change the “*.pyc” part to delete different file types.