Shell – How to delete all files with a given name in all subdirectories

directoryrmshell

I want to delete all files with a given name in all the subdirectories of my home directory.

I tried:

rm -r file

in my home directory, but it didn't work because that file doesn't exist in that directory.

Best Answer

find . -name "filename" -delete