I was trying to delete all files in the current directory and all subdirectories, while keeping the directory structure intact. I found that I could use the following DOS command to recursively delete files, and NOT touch the directories:
ending in .doc
del /s *.doc
Do note though, that ALL files with the extension doc will be deleted. You can change .doc to something else, .mp3 .pdf .wav .am .rm .txt, it’s all up to you. If you require confirmation before deleting, you can have the del command prompt for confirmation before deleting each file by modifying the command slightly:
del /s /p *.doc
Similar Posts:
- Example FTP Session in UNIX
- Recursively Delete Selected Files or Folders In Windows
- Common Useful UNIX Commands
- How To Make and Run Batch Files In Terminal In Mac OSX
- Recursively Download Folders using FTP with wget in UNIX (even SSH)


October 1st, 2008 at 1:39 am
Yea, worked well!