Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have filled up my router's flash with voice files and folders and wanted to remove them. I there a script that can delete all files in flash except for the IOS image?

share|improve this question
What does the manual suggests in this situation? – mailq Oct 22 '11 at 19:52

delete flash:<file> is the command here. Depending of how are named your files, you can either to use a joker :

Router#delete flash:*.bak
Delete filename [*.bak]? 
Delete flash:/test.bak? [confirm]y
Delete flash:/rhgreg.bak? [confirm]y

If this doesn't work, you could try to write a TCL script, but I won't be able to help here.

Last option, copy the IOS image to a ftp/tftp server and delete /recursive flash:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.