find (and delete) files recursively on linux using find

Just as a reminder to myself, I will repost this post on baeldung: Recursively Deleting Files With a Specific Extension

Get an idea of what you’ll be deleting:

$ find . -type f -name '*.txt~' -print
./john.txt~
./middle/ieou.txt~
./b.txt~
...

Reminder: Do backups and check that you’re in the correct location before starting the execution.

$ find . -type f -name '*.txt~' -print -delete
./john.txt~
./middle/ieou.txt~
./b.txt~
...