How to `Rm Dir/*/Foo. Txt` in Windows?

I have a directory with several subdirectories inside and several files inside those. I want to delete all files with the name 'foo.txt' in those subdirectories.

So basically I want Linux's rm dir/*/foo.txt, but del dir\*\foo.txt doesn't do it.

Also, the subdirectories might contain space characters.

1 Answer

This should work after moving to the top folder:

del /s foo.txt

Enter del /? to see the rest of the options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest