Wednesday, July 20, 2022

Linux find and remove files in one command

find /dir/to/search/ -type f -name "FILE-TO-FIND-Regex" -exec rm -f {} \;

find . -name "FILE-TO-FIND" -exec rm -rf {} \;