How to Recursively Delete a File Type in a Directory – Unix

Use find

Example uses deletion of mp4 files.

Run

find /some/dir/ -maxdepth 10 -type f -name "*.mp4"

You will see a list of mp4 files. Now you just need to add -delete option to delete them.

The complete Command

find /some/dir/ -maxdepth 10 -type f -name "*.mp4" - delete


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *