Linux: Find and remove files or directories with specific word at once with one command

Do you ever needed to delete specific files or folders containing a specific word at once on Linux?
Then these commands should help you:

1) find . -name "FILE-TO-FIND"-exec rm -rf {} \;
or
2) find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;

Use option (1) if you need to remove files & folders at the same time containing the word “FILE-TO-FIND” in current directory and its sub-directories.
Use option (2) if you need to remove only files containing the word “FILE-TO-FIND” in current directory and its sub-directories.You can also combine wildcards like “*FILE-TO-FIND*”.

More Examples of find command:

(a) Find all files having .bak (*.bak) extension in current directory and remove them:

find . -type f -name "*.bak" -exec rm -f {} \;

(b) Find all *.bak files in current directory and removes them with confirmation from user:

find . -type f -name "*.bak" -exec rm -i {} \;