Deleting Files
To delete a file from a CF memory card, enter the delete flash: command.
If you are using a Class B flash file system, after you enter the delete flash: command, the memory space
of the deleted file remains occupied, although the deleted file cannot be recovered. To reclaim the
memory space occupied by a deleted file, enter the squeeze flash: command, in privileged EXEC mode.
Note
The squeeze flash command applies only to the Class B flash file system. This command is unnecessary
with Class C flash file systems, because unused file space is recovered automatically. Moreover, the
squeeze flash command is not supported on Cisco 1800 series routers or Cisco 2801 routers.
The dir flash: command does not display deleted files and files with errors. On Class B flash file
Note
systems, to display all files, including files with errors and deleted files whose memory space have not
been reclaimed with the squeeze flash: command, enter the dir /all flash: command or the show flash:
command in privileged EXEC mode.
Deleting a File from a CompactFlash Memory Card with a Class B Flash File System: Example
In the following example, the file c28xx-i-mz.tmp is deleted from the external CF memory card:
Router# delete flash:c28xx-i-mz.tmp
Delete filename [c28xx-i-mz.tmp]?
Delete flash:c28xx-i-mz.tmp? [confirm]
Because the file was deleted, it does not appear when you enter the dir flash: command:
Router# dir flash:
However, if you are using a Class B file system, because the deleted file's memory space has not yet
been reclaimed, the deleted file is listed when you enter the show flash: command:
Router# show flash:
Flash Compact Flash directory:
File
1
2
[12916544 bytes used, 3139776 available, 16056320 total]
15680K bytes of ATA Compact Flash (Read/Write)
To reclaim the memory space of deleted files, enter the squeeze flash: command:
Router# squeeze flash:
Squeeze operation may take a while. Continue? [confirm]
squeeze in progress...
sssssssssssssssssssssssseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Rebuild file system directory...
Squeeze complete
OL-5596-01
Directory of flash:/
1580
-rw-
6462268
3
-rw-
6458388
63930368 bytes total (51007488 bytes free)
Length
Name/status
6458208
c28xx-i-mz.tmp [deleted]
6458208
c28xx-i-mz
Mar 06 2004 06:14:02
c28xx-i-mz.3600ata
Mar 01 2004 00:01:24
File Operations on CompactFlash Memory Cards
c28xx-i-mz
Using CompactFlash Memory Cards
7