Delete files by mask in Bash (Terminal)

No comments on Delete files by mask in Bash (Terminal)

Written by

in

Go to the folder, where you want to delete for instance all mp3 files in this folder and it’s subfolders and type this:

$ for i in $( find . -name "*.mp3" ); do rm -f $i; done  

If you want to delete files by mask only in current folder, type this:

$ rm -rf *.mp3

Comments

Leave a Reply

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