Removing directories

Answered Question
Jul 10th, 2007

Is there any easy way to remove a directory to create space in the flash, without having to delete everysingle file in it first?

rmdir does not work if there are files in the directory.

thks

I have this problem too.
0 votes
Correct Answer by Joe Clarke about 9 years 6 months ago

Doing this will break your HTML management interface. But the command would be:

delete /recursive /force flash:/c2940-i6q4l2-mz.121-22.EA6/html/images

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Joe Clarke Tue, 07/10/2007 - 09:34

You can use the /recursive option to delete:

delete /recursive flash:dir

You can also pass /force if you do not want to confirm each file:

delete /recursive /force flash:dir

srego4 Tue, 07/10/2007 - 09:49

HI,

I must be doing something wrong. Tried what you said but it does not seem to be doing any deleting.

I am attaching a file showing my directory structure.

What I am trying to do is to delete the directory "images" under flash:/c2940-i6q4l2-mz.121-22.EA6.bin/html/images

Attachment: 
Correct Answer
Joe Clarke Tue, 07/10/2007 - 09:58

Doing this will break your HTML management interface. But the command would be:

delete /recursive /force flash:/c2940-i6q4l2-mz.121-22.EA6/html/images

srego4 Tue, 07/10/2007 - 10:03

Thats great. I do not use the html interface.

So in theory I could delete the html directory directly and that would delete the images directory underneath it.

Thanks again.

Joe Clarke Tue, 07/10/2007 - 10:04

That is correct.

In the future, if you don't want the HTML interface, just download the .bin images from Cisco.com.

srego4 Tue, 07/10/2007 - 10:07

The problem is Cisco ships all the switches with these html images as default. I have tried to get them to not do it, but it would be too expensive and I guess a nightmare for them too.... (even tho, I am ordering abt 500 switches from them a year!)

Actions

This Discussion