cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
9596
Views
25
Helpful
6
Replies

Delete Multiple rwx entries in Flash in one command on Cisco 3750x

anthonywilson5
Level 1
Level 1

I wanted to know if there was a single command to delete multiple rwx entries on a Cisco 3750x Switch. I am trying to free up space. I am aware of the delete flash:/(file name) command but am not able to find a batch delete command for these entries. These are the following that I would like to remove without having to do them individually.

594  -rwx      106776  Sep 25 2016 19:37:59 -04:00  Sep-25-19-37-56.976-EDT-76

  595  -rwx      106776  Sep 26 2016 19:41:42 -04:00  Sep-26-19-41-40.706-EDT-77

  596  -rwx      106776  Sep 27 2016 19:45:28 -04:00  Sep-27-19-45-26.162-EDT-78

  597  -rwx      106776  Sep 28 2016 19:49:11 -04:00  Sep-28-19-49-09.804-EDT-79

  598  -rwx      105926   Jan 1 2006 19:02:57 -05:00  -Jan--1-19-02-43.854-EST-0

  599  -rwx      108947  Oct 25 2016 10:03:18 -04:00  Oct-25-10-03-18.245-EDT-9

  600  -rwx      106126  Sep 16 2016 19:04:17 -04:00  Sep-16-19-04-15.233-EDT-67

  601  -rwx      106126  Sep 17 2016 19:07:59 -04:00  Sep-17-19-07-57.656-EDT-68

  602  -rwx      106126  Sep 18 2016 19:11:48 -04:00  Sep-18-19-11-46.401-EDT-69

  603  -rwx      106126  Sep 19 2016 19:15:34 -04:00  Sep-19-19-15-32.062-EDT-70

  604  -rwx      106126  Sep 20 2016 19:19:19 -04:00  Sep-20-19-19-17.060-EDT-71

  605  -rwx      106126  Sep 21 2016 19:23:07 -04:00  Sep-21-19-23-05.107-EDT-72

  606  -rwx      106776  Sep 22 2016 19:26:53 -04:00  Sep-22-19-26-49.241-EDT-73

  607  -rwx      108947  Oct 25 2016 10:07:18 -04:00  Oct-25-10-07-17.892-EDT-10

  608  -rwx      109805  Oct 14 2016 21:54:07 -04:00  Oct-14-21-54-05.627-EDT-16

  609  -rwx      109805  Oct 15 2016 21:57:41 -04:00  Oct-15-21-57-39.965-EDT-17

  610  -rwx      109805  Oct 16 2016 22:01:15 -04:00  Oct-16-22-01-13.326-EDT-18

  611  -rwx      108945  Oct 21 2016 10:36:19 -04:00  Oct-21-10-36-19.788-EDT-4

  612  -rwx      105973   Oct 3 2016 21:13:02 -04:00  Oct--3-21-13-00.688-EDT-5

  613  -rwx      105973   Oct 4 2016 21:16:48 -04:00  Oct--4-21-16-46.782-EDT-6

  614  -rwx      105973   Oct 5 2016 21:20:35 -04:00  Oct--5-21-20-33.113-EDT-7

  615  -rwx      105973   Oct 6 2016 21:24:20 -04:00  Oct--6-21-24-18.534-EDT-8

  616  -rwx      105973   Oct 7 2016 21:28:04 -04:00  Oct--7-21-28-02.330-EDT-9

  617  -rwx      105973   Oct 8 2016 21:31:52 -04:00  Oct--8-21-31-50.219-EDT-10

  618  -rwx      105973   Oct 9 2016 21:35:44 -04:00  Oct--9-21-35-41.979-EDT-11

  619  -rwx      105973  Oct 10 2016 21:39:29 -04:00  Oct-10-21-39-27.904-EDT-12

  620  -rwx      105973  Oct 11 2016 21:43:16 -04:00  Oct-11-21-43-14.094-EDT-13

  621  -rwx      109805  Oct 12 2016 21:47:00 -04:00  Oct-12-21-46-56.360-EDT-14

  622  -rwx      105973  Oct 18 2016 11:50:00 -04:00  Oct-18-11-49-56.295-EDT-1

  623  -rwx      105973  Oct 19 2016 11:53:51 -04:00  Oct-19-11-53-49.707-EDT-2

  626  -rwx      110239  Oct 21 2016 12:01:26 -04:00  Oct-21-12-01-21.172-EDT-5

  627  -rwx      110239  Oct 22 2016 12:05:11 -04:00  Oct-22-12-05-09.199-EDT-6

  628  -rwx      110239  Oct 23 2016 12:08:58 -04:00  Oct-23-12-08-55.992-EDT-7

630  -rwx       84970  Oct 26 2016 16:12:49 -04:00  Oct-26-16-12-49.743-EDT-3

  631  -rwx       85013  Oct 26 2016 16:16:15 -04:00  Oct-26-16-16-14.828-EDT-4

I am new to Cisco so please respond with an answer that is understandable. Thank you in advance for your time and assistance.

 

6 Replies 6

Mark Malone
VIP Alumni
VIP Alumni

Hi

unfortunately not , you would have to wipe the whole flash through format you could do that then re-upload the ios , the only other way is line per line

Thank you sir for your quick response.

Not really. Some of the newer flash/file-systems allow you to use wildcard. Here is an example:

Switch#delete flash:run-*
Delete filename [run-*]?
Delete flash:/run-1? [confirm]
Delete flash:/run-2? [confirm]
Delete flash:/run-3? [confirm]
Delete flash:/run-4? [confirm]
Switch#delete flash:run-*
Delete filename [run-*]?
No such file
Switch#

For this purpose, I created four files of the running-config and named them as run-1 through run-4. Then, proceeded to use delete flash:run-* Notice that after fourth [confirm], all files that matched the run-* were deleted from the flash:.


Anthony - IOS has been around for little over 30 years. Things change quite a bit. Back in the day, when flash development was primitive, there were quite a few limitations including very very slow ready/write performance. This does not mean things remain the same.

I like the way you posed the question - including evidence of the problem/question. This is extremely helpful. Since you say you are new, the authoritative answers are often found by trying it out for yourself, especially for non-destructive testing like this one.

Here is another variation using wildcard:

Switch#delete flash:*Conf*
Delete filename [*Conf*]?
Delete flash:/Oct-Conf? [confirm]
Delete flash:/Nov-Conf-1? [confirm]
Delete flash:/Dec-Conf-2? [confirm]
Switch#

Taking this to your situation, to delete the files selectively, please consider trying delete flash:*E?T*. I don't know what's is going to happen, but worth trying, right? :-)

Since delete is a destructive operation, consider issuing dir flash:*E?T* and see if the results are the files you want to delete.

Kind regards ... Palani

PS The above attempts were tried in this device:

Switch#show ver | i IO
Cisco IOS Software, C3750E Software (C3750E-UNIVERSALK9-M), Version 15.2(4)E1, RELEASE SOFTWARE (fc2)
Switch#




Kind regards .... Palani


Hello, I had the same question on removing those files. What I'm concerned with is the type of file I'm deleting and what generated it. The files displayed in the question look very similar to the files on some of our switches. They appear right after we make changes to the switch so figured it's a log file of some sort. I've checked against other configurations on our network but don't see anything that could turn that functionality on as we send all files to a syslog server. Would you happen to be aware of any settings that would generate these types of files? I was looking into SNMP-server traps for a clue.

ej

 

Good man! Saved me an hour of deleting pcm.datX files
Used delete flash:/pcm.datX*
Much thanks,
Jace

Thanks! This worked for me! I had a lot of archive files to delete, so using the delete flash:*wildcard* command helped me delete like 6 million archive files. Lol.

Review Cisco Networking for a $25 gift card