Linux or UNIX – Find and remove file command – bash
Find and remove file (about name)
find . -name "FILE-TO-FIND"-exec rm -rf {} \;
Find and remove file (about file type)
find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;
Find all *.bak files in current directory and removes them with confirmation from user:
$ find . -type f -name "*.bak" -exec rm -i {} \;
Find all core files and remove them:
find / -name core -exec rm -f {} \;