Terminal icon


[Linux] Delete all matching files current and sub directories

18 Feb , 2013  

Today I am going to share a quick tip which will show you how you can delete certain matched files in current directory and it’s sub directories. We are going to use wild card to delete all .exe files in a folder & subfolder.

find . -name *.exe -type f -delete #to delete all files which have .exe extension

find . -name img_*.jpg -type f -delete #to delete all jpg images which start from img_

That’s a simple way to delete all the files within sub-directories. It’s quite easy and is really helpful at times.

Stay Digified!!
Sachin Khosla

, ,

Comments are closed.

More in howto, Linux (9 of 142 articles)

Everyone uses built-in compression functionality of Mac OS X with a simple right click. This is useful when you need ...