for /d is designed for just this type of use. Something like this should work ( remove one of the % if you're testing from the command line): for /d %%i in.
I want to delete all *.o files in a directory and its sub-directories. is for removing directories matching a pattern, not files as in this question!.
Questions delete files matching pattern - tourThis will find and unlink all TXT files in a tree. I need to recursively remove all files in all subdirs where the filename contains a number followed by an 'x' followed by a number, at least two times. The answer's title is a mismatch, but its accepted solution deletes files by glob pattern. You're not far off, actually:. Dont't forget the find's -delete option. I've tried this command:.. The best answers are voted up and rise to the top.
Quick Coding with Brackets - File Management
Questions delete files matching pattern -- expedition easy
Sign up or log in. This site is not affiliated with Linus Torvalds or The Open Group in any way. If performance was the primary goal, I would unequivocally agree that File::Find is probably not what one wants. What would be a safe way to tackle file deletion?