I am looking for syntax I saw somewhere but can not find now. Working with the results of a find delete the files found.

The syntax is something like this:

for i in "${find . -name '*.ini'}"; do rm $i; done

Am I dreaming or is this possible?

Recommended Answers

All 2 Replies

Member Avatar for b1izzard

Instead of using for loop you can delete files by using

        find  . -name '*.ini' -exec rm '{}' \;    

Thanks ravi89. It'll do the trick. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.