Table Of Contents
Cisco IOS File System Commands
cd
delete
dir
erase
file prompt
format
fsck
mkdir
more
pwd
rename
rmdir
show configuration
show file descriptors
show file information
show file systems
squeeze
undelete
verify
write erase
write terminal
Cisco IOS File System Commands
This chapter describes the commands used to configure the Cisco IOS File System (IFS) in Cisco IOS Release 12.0.
For IFS configuration tasks, refer to the "Configuring the Cisco IOS File System" chapter in the Cisco IOS Release 12.0 Configuration Fundamentals Configuration Guide.
cd
To change the default directory or file system, use the cd EXEC command.
cd [filesystem:]
Syntax Description
filesystem:
|
(Optional) URL of the directory or file system followed by a colon.
|
Defaults
The initial default file system is flash:. For platforms that do not have a physical device named flash:, the keyword flash: is aliased to the default Flash device.
If you do not specify a directory on a file system, the default is the root directory on that file system.
Command Modes
EXEC
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
For all EXEC commands that have an optional filesystem argument, the system uses the file system specified by the cd command when you omit the optional filesystem argument. For example, the dir command, which displays a list of files on a file system, contain an optional filesystem argument. When you omit this argument, the system lists the files on the file system specified by the cd command.
Examples
The following example sets the default file system to the Flash memory card inserted in the slot 0:
Related Commands
Command
|
Description
|
copy
|
Copies any file from a source to a destination.
|
delete
|
Deletes a file on a Flash memory device.
|
dir
|
Displays a list of files on a file system.
|
pwd
|
Shows the current setting of the cd command.
|
show file systems
|
Lists available file systems.
|
undelete
|
Recovers a file marked "deleted" on a Class A or Class B Flash file system.
|
delete
To delete a file on a Flash memory device, use the delete EXEC command.
delete flash-url
Syntax Description
flash-url
|
URL of the file to be deleted.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
When you delete a file, the software simply marks the file as deleted, but it does not erase the file. This feature allows you to later recover a "deleted" file using the undelete command. You can delete and undelete a file up to 15 times. To permanently delete all files marked "deleted" on a Flash memory device, use the squeeze command.
If you attempt to delete the configuration file or image specified by the CONFIG_FILE or BOOTLDR environment variable, the system prompts you to confirm the deletion. Also, if you attempt to delete the last valid system image specified in the BOOT environment variable, the system prompts you to confirm the deletion.
Examples
The following example deletes the file named test from the Flash card inserted in slot 0:
Router# delete slot0:test
Delete slot0:test? [confirm]
Related Commands
Command
|
Description
|
cd
|
Changes the default directory or file system.
|
dir
|
Displays a list of files on a file system.
|
show bootvar
|
Displays the contents of the BOOT environment variable, the name of the configuration file pointed to by the CONFIG_FILE environment variable, the contents of the BOOTLDR environment variable, and the configuration register setting.
|
squeeze
|
Permanently deletes Flash files by squeezing a Class A Flash file system.
|
undelete
|
Recovers a file marked "deleted" on a Class A or Class B Flash file system.
|
dir
To display a list of files on a file system, use the dir EXEC command.
dir [/all] [filesystem: | file-url]
Syntax Description
/all
|
(Optional) Lists deleted files, undeleted files, and files with errors.
|
filesystem:
|
(Optional) File system or directory containing the file(s) to list followed by a colon.
|
file-url
|
(Optional) Name of the file(s) to display on a specified device. The files can be of any type. You can use wildcards in the filename. A wildcard character (*) matches all patterns. Strings after a wildcard are ignored.
|
Defaults
The default file system is specified by the cd command. When you omit the /all keyword, the Cisco IOS software displays only undeleted files.
Command Modes
EXEC
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
Use the show filesystems command to display more detail about the files in a particular file system.
Examples
The following is sample output from the dir command:
1 -rw- 4720148 Aug 29 1997 17:49:36 hampton/nitro/c7200-j-mz
2 -rw- 4767328 Oct 01 1997 18:42:53 c7200-js-mz
5 -rw- 639 Oct 02 1997 12:09:32 rally
7 -rw- 639 Oct 02 1997 12:37:13 the_time
20578304 bytes total (3104544 bytes free)
1 -rw- 4720148 Aug 29 1997 17:49:36 hampton/nitro/c7200-j-mz
2 -rw- 4767328 Oct 01 1997 18:42:53 c7200-js-mz
3 -rw- 7982828 Oct 01 1997 18:48:14 [rsp-jsv-mz]
4 -rw- 639 Oct 02 1997 12:09:17 [the_time]
5 -rw- 639 Oct 02 1997 12:09:32 rally
6 -rw- 639 Oct 02 1997 12:37:01 [the_time]
7 -rw- 639 Oct 02 1997 12:37:13 the_time
Table 15 described the fields shown in these displays.
Table 15 dir Field Descriptions
Field
|
Description
|
1
|
Index number of the file.
|
-rw-
|
Permissions. The file can be any or all of the following:
• d—directory
• r—readable
• w—writable
• x—executable
|
4720148
|
Size of the file.
|
Aug 29 1997 17:49:36
|
Last modification date.
|
hampton/nitro/c7200-j-mz
|
Filename. Deleted files are indicated by square brackets around the filename.
|
Related Commands
Command
|
Description
|
cd
|
Changes the default directory or file system.
|
delete
|
Deletes a file on a Flash memory device.
|
undelete
|
Recovers a file marked "deleted" on a Class A or Class B Flash file system.
|
erase
To erase a file system, use the erase EXEC command.The erase nvram: command replaces the write erase command and the erase startup-config command.
erase filesystem:
Syntax Description
filesystem:
|
File system name followed by a colon.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
When a file system is erased, none of the files in the file system can be recovered.
The erase command can be used on both Class B and Class C Flash file systems only. To reclaim space on Flash file systems after deleting files using the delete command, you must use the erase command. This command erases all of the files in the Flash file system.
Class A Flash file systems cannot be erased. You can delete individual files using the delete command and then reclaim the space using the squeeze command. You can also use the format command to format the Flash file system.
On Class C Flash file systems, space is dynamically reclaimed when you use the delete command. You can also use either the format or erase command to reinitialize a Class C Flash file system.
The erase nvram: command erases NVRAM. On Class A file system platforms, if the CONFIG_FILE variable specifies a file in Flash memory, the specified file will be marked "deleted."
Examples
The following example erases the NVRAM, including the startup configuration located there:
The following example erases all of partition 2 in internal Flash memory:
System flash directory, partition 2:
1 1711088 dirt/images/c3600-i-mz
[1711152 bytes used, 15066064 available, 16777216 total]
Erase flash device, partition 2? [confirm]
Are you sure? [yes/no]: yes
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
The following example erases Flash memory when Flash is partitioned, but no partition is specified in the command:
System flash partition information:
Partition Size Used Free Bank-Size State Copy-Mode
1 4096K 2048K 2048K 2048K Read Only RXBOOT-FLH
2 4096K 2048K 2048K 2048K Read/Write Direct
[Type ?<no> for partition directory; ? for full directory; q to abort]
Which partition? [default = 2]
The system will prompt only if there are two or more read/write partitions. If the partition entered is not valid or is the read-only partition, the process terminates. You can enter a partition number, a question mark (?) for a directory display of all partitions, or a question mark and a number (?number) for directory display of a particular partition. The default is the first read/write partition.
System flash directory, partition 2:
1 3459720 master/igs-bfpx.100-4.3
[3459784 bytes used, 734520 available, 4194304 total]
Erase flash device, partition 2? [confirm] <Return>
Related Commands
Command
|
Description
|
boot config
|
Specifies the device and filename of the configuration file from which the router configures itself during initialization (startup).This command is only available on Class A file system platforms.
|
delete
|
Deletes a file on a Flash memory device.
|
more nvram:startup-config
|
Displays the startup configuration file contained in NVRAM or specified by the CONFIG_FILE environment variable. See the more command for details.
|
show bootvar
|
Displays the contents of the BOOT environment variable, the name of the configuration file pointed to by the CONFIG_FILE environment variable, the contents of the BOOTLDR environment variable, and the configuration register setting
|
undelete
|
Recovers a file marked "deleted" on a Class A or Class B Flash file system.
|
file prompt
To specify the level of prompting, use the file prompt global configuration command.
file prompt [alert | noisy | quiet]
Syntax Description
alert
|
(Optional) Prompts only for destructive file operations. This is the default.
|
noisy
|
(Optional) Confirms all file operation parameters.
|
quiet
|
(Optional) Seldom prompts for file operations.
|
Defaults
alert
Command Modes
Global configuration
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
Use this command to change the amount of confirmation needed for different file operations.
This command affects only prompts for confirmation of operations. The router will always prompt for missing information.
Examples
The following example configures confirmation prompting for all file operations:
format
To format a Class A or Class C Flash file system, use the format EXEC command.
Class C Flash file systems
format filesystem1:
Class A Flash file system
format [spare spare-number] filesystem1: [[filesystem2:][monlib-filename]]
Caution 
Reserve a certain number of memory sectors as spares, so that if some sectors fail, most of the flash memory card can still be used. Otherwise, you must reformat the flash card when some of the sectors fail.
Syntax Description
spare
|
(Optional) Reserves spare sectors as specified by the spare-number argument when formatting Flash memory.
|
spare-number
|
(Optional) Number of the spare sectors to reserve on formatted Flash memory. Valid values are 0 to 16. The default value is zero.
|
filesystem1:
|
Flash memory to format followed by a colon.
|
filesystem2:
|
(Optional) File system containing the monlib file to use for formatting filesystem1 followed by a colon.
|
monlib-filename
|
(Optional) Name of the ROM monitor library file (monlib file) to use for formatting filesystem1. The default monlib file is the one bundled with the system software.
When used with HSA and you do not specify the monlib-filename, the system takes ROM monitor library file from the slave image bundle. If you specify the monlib-filename, the system assumes that the files reside on the slave devices.
|
Defaults
The default monlib file is the one bundled with the system software.
The default number of spare sectors is zero (0).
Command Modes
EXEC
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
Use this command to format Class A or C Flash memory file systems.
In some cases, you might need to insert a new PCMCIA Flash memory card and load images or backup configuration files onto it. Before you can use a new Flash memory card, you must format it.
Sectors in flash memory cards can fail. Reserve certain Flash memory sectors as "spares" by using the optional spare argument on the format command to specify between 0 and 16 sectors as spares. If you reserve a small number of spare sectors for emergencies, you can still use most of the Flash memory card. If you specify 0 spare sectors and some sectors fail, you must reformat the Flash memory card, thereby erasing all existing data.
The monlib file is the ROM monitor library. The ROM monitor uses this file to access files in the Flash file system. The Cisco IOS system software contains a monlib file.
In the command syntax, filesystem1: specifies the device to format and filesystem2: specifies the optional device containing the monlib file, used to format filesystem1:. If you omit the optional filesystem2: and monlib-filename arguments, the system formats filesystem1:, using the monlib file already bundled with the system software. If you omit only the optional filesystem2: argument, the system formats filesystem1:, using the monlib file from the device you specified with the cd command. If you omit only the optional monlib-filename argument, the system formats filesystem1: using filesystem2:'s monlib file. When you specify both arguments—filesystem2: and monlib-filename—the system formats filesystem1:, using the monlib file from the specified device. You can specify filesystem1:'s own monlib file in this argument. If the system cannot find a monlib file, it terminates its formatting.

Caution 
You can read from or write to Flash memory cards formatted for Cisco 7000 series Route Processor (RP) cards in your Cisco
7200 and 7500 series, but you cannot boot the
Cisco 7200 and 7500 series from a Flash memory card formatted for the Cisco 7000 series. Similarly, you can read from or write to Flash memory cards formatted for the
Cisco 7200 and 7500 series in your Cisco 7000 series, but you cannot boot the Cisco 7000 series from a Flash memory card formatted for the
Cisco 7200 and 7500 series.
Examples
The following example formats a Flash memory card inserted in slot 0:
Running config file on this device, proceed? [confirm]y
All sectors will be erased, proceed? [confirm]y
Enter volume id (up to 31 characters): <Return>
Formatting sector 1 (erasing)
Format device slot0 completed
When the console returns to the EXEC prompt, the new Flash memory card is successfully formatted and ready for use.
Related Commands
Command
|
Description
|
cd
|
Changes the default directory or file system.
|
copy
|
Copies any file from a source to a destination.
|
delete
|
Deletes a file on a Flash memory device.
|
show file systems (Flash file system)
|
Lists available file systems.
|
squeeze
|
Permanently deletes Flash files by squeezing a Class A Flash file system.
|
undelete
|
Recovers a file marked "deleted" on a Class A or Class B Flash file system.
|
fsck
To check a Class C Flash file system for damage and repair any problems, use the fsck EXEC command.
fsck [/nocrc] filesystem:
Syntax Description
/nocrc
|
(Optional) Skips CRC checks.
|
filesystem:
|
File system to check.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.3 AA
|
This command was introduced.
|
Usage Guidelines
This command is only valid on Class C Flash file systems.
Examples
The following example checks the flash: file system:
Fsck operation may take a while. Continue? [confirm]
flashfs[4]: 0 files, 2 directories
flashfs[4]: 0 orphaned files, 0 orphaned directories
flashfs[4]: Total bytes: 8128000
flashfs[4]: Bytes used: 1024
flashfs[4]: Bytes available: 8126976
flashfs[4]: flashfs fsck took 23 seconds.
mkdir
To create a new directory in a Class C Flash file system, use the mkdir EXEC command.
mkdir directory
Syntax Description
directory
|
Name of the directory to create.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.3 AA
|
This command was introduced.
|
Usage Guidelines
This command is only valid on Class C Flash file systems.
If you do not specify the directory name in the command line, the router prompts you for it.
Examples
The following example creates a directory named newdir:
Mkdir file name [newdir]?
2 drwx 0 Mar 13 1993 13:16:21 newdir
8128000 bytes total (8126976 bytes free)
Related Commands
Command
|
Description
|
dir
|
Displays a list of files on a file system.
|
rmdir
|
Removes an existing directory in a Class C Flash file system.
|
more
To display a file, use the more EXEC command.
more [/ascii | /binary | /ebcdic] file-url
Syntax Description
/ascii
|
(Optional) Displays a binary file in ASCII format.
|
/binary
|
(Optional) Displays a file in hex/text format.
|
/ebcdic
|
(Optional) Displays a binary file in EBCDIC format.
|
file-url
|
URL of the file to display.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.3 AA
|
This command was introduced.
|
12.0(1)
|
This command was integrated into the 12.0 mainline release.
|
Usage Guidelines
The more nvram:startup-config command replaces the show startup-config command and the show configuration command. The more system:running-config command replaces the show running-config command and the write terminal command.
Note
The show startup-config and show running-config commands continue to function, but now act as command aliases for the more versions of these commands.
You can use this command to display configuration files:
•
The more nvram:startup-config command displays the startup configuration file contained in NVRAM or specified by the CONFIG_FILE environment variable. The Cisco IOS software informs you whether the displayed configuration is a complete configuration or a distilled version. A distilled configuration is one that does not contain access lists.
•
The more system:running-config command displays the running configuration.
These commands shows the version number of the software used when you last changed the configuration file.
You can also display files on remote systems using the more command.
Examples
The following partial sample output displays the configuration file named startup-config in NVRAM:
Router# more nvram:startup-config
! No configuration change since last restart
! NVRAM config last updated at 02:03:26 PDT Thu Oct 2 1997
service timestamps debug uptime
service timestamps log uptime
service password-encryption
service udp-small-servers
service tcp-small-servers
The following is partial sample output from the more nvram:startup-config command when the configuration file has been compressed:
Router# more nvram:startup-config
Using 21542 out of 65536 bytes, uncompressed size = 142085 bytes
The following partial sample output displays the running configuration:
Router2# more system:running-config
Building configuration...
no service udp-small-servers
no service tcp-small-servers
Related Commands
Command
|
Description
|
boot config
|
Specifies the device and filename of the configuration file from which the router configures itself during initialization (startup).This command is only available on Class A file system platforms.
|
service compress-config
|
Compresses startup configuration files.
|
show bootvar
|
Displays the contents of the BOOT environment variable, the name of the configuration file pointed to by the CONFIG_FILE environment variable, the contents of the BOOTLDR environment variable, and the configuration register setting.
|
pwd
To show the current setting of the cd command, use the pwd EXEC command.
pwd
Syntax Description
This command has no arguments or keywords.
Command Modes
EXEC
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
Use the pwd command to show what directory or file system is specified as the default by the cd command. For all EXEC commands that have an optional filesystem argument, the system uses the file system specified by the cd command when you omit the optional filesystem argument.
For example, the dir command contains an optional filesystem argument and displays a list of files on a particular file system. When you omit this filesystem argument, the system shows a list of the files on the file system specified by the cd command.
Examples
The following example shows that the present working file system specified by the cd command is slot 0:
The following example uses the cd command to change the present file system to slot 1: and then uses the pwd command to display that present working file system:
Related Commands
Command
|
Description
|
cd
|
Changes the default directory or file system.
|
dir
|
Displays a list of files on a file system.
|
rename
To rename a file in a Class C Flash file system, use the rename EXEC command.
rename url1 url2
Syntax Description
url1
|
Original path name.
|
url2
|
New path name.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.3 AA
|
This command was introduced.
|
Usage Guidelines
This command is valid only on Class C Flash file systems.
Examples
In the following example, the file named Karen.1 is renamed test:
Directory of disk0:/Karen.dir/
0 -rw- 0 Jan 21 1998 09:51:29 Karen.1
0 -rw- 0 Jan 21 1998 09:51:29 Karen.2
0 -rw- 0 Jan 21 1998 09:51:29 Karen.3
0 -rw- 0 Jan 21 1998 09:51:31 Karen.4
243 -rw- 165 Jan 21 1998 09:53:17 Karen.cur
340492288 bytes total (328400896 bytes free)
Router# rename disk0:Karen.dir/Karen.1 disk0:Karen.dir/test
Directory of disk0:/Karen.dir/
0 -rw- 0 Jan 21 1998 09:51:29 Karen.2
0 -rw- 0 Jan 21 1998 09:51:29 Karen.3
0 -rw- 0 Jan 21 1998 09:51:31 Karen.4
243 -rw- 165 Jan 21 1998 09:53:17 Karen.cur
0 -rw- 0 Apr 24 1998 09:49:19 test
340492288 bytes total (328384512 bytes free)
rmdir
To remove an existing directory in a Class C Flash file system, use the rmdir EXEC command.
rmdir directory
Syntax Description
directory
|
Directory to delete.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.3 AA
|
This command was introduced.
|
Usage Guidelines
This command is valid only on Class C Flash file systems.
Examples
The following example deletes the directory named newdir:
2 drwx 0 Mar 13 1993 13:16:21 newdir
8128000 bytes total (8126976 bytes free)
Rmdir file name [newdir]?
Delete flash:newdir? [confirm]
8128000 bytes total (8126976 bytes free)
Related Commands
Command
|
Description
|
dir
|
Displays a list of files on a file system.
|
mkdir
|
Creates a new directory in a Class C Flash file system.
|
show configuration
The more nvram:startup-config command replaces the show configuration command. Refer to the more command for further details.
show file descriptors
To display a list of open file descriptors, use the show file descriptors EXEC command.
show file descriptors
Syntax Description
This command has no arguments or keywords.
Command Modes
EXEC
Command History
Release
|
Modification
|
11.3 AA
|
This command was introduced.
|
Usage Guidelines
File descriptors are the internal representations of open files. You can use this command to see if another user has a file open.
Examples
The following is sample output from the show file descriptors command:
Router# show file descriptors
FD Position Open PID Path
0 187392 0001 2 tftp://dirt/hampton/c4000-i-m.a
1 184320 030A 2 flash:c4000-i-m.a
Table 16 describes the fields show in this display.
Table 16 show file descriptors Field Descriptions
Field
|
Description
|
FD
|
File descriptor. The file descriptor is a small integer used to specify the file once it has been opened.
|
Position
|
Byte offset from the start of the file.
|
Open
|
Flags supplied when opening the file.
|
PID
|
Process ID of the process that opened the file.
|
Path
|
Location of the file.
|
show file information
To display information about a file, use the show file information EXEC command.
show file information file-url
Syntax Description
file-url
|
URL of the file to display.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.3 AA
|
This command was introduced.
|
Examples
The following is sample output from the show file information command:
Router# show file information tftp://dirt/hampton/c2500-j-l.a
tftp://dirt/hampton/c2500-j-l.a:
type is image (a.out) [relocatable, run from flash]
file size is 8624596 bytes, run size is 9044940 bytes [8512316+112248+420344]
Router# show file information slot0:c7200-js-mz
file size is 4770316 bytes, run size is 4935324 bytes
Runnable image, entry point 0x80008000, run from ram
Router1# show file information nvram:startup-config
Table 17 describes the possible file types.
Table 17 Possible File Types
Types
|
Description
|
image (a.out)
|
Runnable image in a.out format.
|
image (elf)
|
Runnable image in elf format.
|
ascii text
|
Configuration file or other text file.
|
coff
|
Runnable image in coff format.
|
ebcdic
|
Text generated on an IBM mainframe.
|
lzw compression
|
Lzw compressed file.
|
tar
|
Text archive file used by the CIP.
|
show file systems
To list available file systems, use the show file systems EXEC command.
show file systems
Syntax Description
This command has no arguments or keywords.
Command Modes
EXEC
Command History
Release
|
Modification
|
11.3 AA
|
This command was introduced.
|
Usage Guidelines
Use this command to learn the names of the file systems your router supports.
Examples
The following is sample output from the show file systems command:
Router# show file systems
Size(b) Free(b) Type Flags Prefixes
* 4194304 4190616 flash rw flash:
131066 129185 nvram rw nvram:
Table 19 describes the possible file systems.
Table 18 show file systems Field Descriptions
Type
|
Description
|
Size(b)
|
Amount of memory in the file system, in bytes.
|
Free(b)
|
Amount of free memory in the file system, in bytes.
|
Type
|
Type of file system.
|
Flags
|
Permissions for file system.
|
Prefixes
|
Prefix for file system.
|
Type
|
Description
|
disk
|
The file system is for a rotating medium.
|
flash
|
The file system is for a Flash memory device.
|
network
|
The file system is a network file system (TFTP, rcp, FTP, etc.).
|
nvram
|
The file system is for an NVRAM device.
|
opaque
|
The file system is a locally generated "pseudo" file system (e.g., the "system") or a download interface, such as brimux.
|
rom
|
The file system is for a ROM or EPROM device.
|
tty
|
The file system is for a collection of terminal devices.
|
unknown
|
The file system is of unknown type.
|
Table 19 describes file system flags.
Table 19 Possible File System Flags
Flag
|
Description
|
ro
|
The file system is Read Only.
|
rw
|
The file system is Write Only.
|
wo
|
The file system is Read/Write.
|
squeeze
To permanently delete Flash files by squeezing a Class A Flash file system, use the squeeze EXEC command.
squeeze filesystem:
Syntax Description
filesystem:
|
Flash file system followed by a colon.
|
Command Modes
EXEC
Command History
Release
|
Modification
|
11.1
|
This command was introduced.
|
Usage Guidelines
When Flash memory is full, you might need to rearrange the files so that the space used by the files marked "deleted" can be reclaimed. When you issue the squeeze command, the router copies all valid files to the beginning of Flash memory and erases all files marked "deleted." At this point, you cannot recover "deleted" files and you can write to the reclaimed Flash memory space.
In addition to removing deleted files, the squeeze command removes any files that the system has marked as error. An error file is created when a file write fails (for example, the device is full). To remove error files, you must use the squeeze command.
Note
The squeeze operation might take as long as several minutes because it can involve erasing and rewriting almost an entire Flash memory space.
Examples
The following example instructs the router to permanently erase the files marked "deleted" from the Flash memory card inserted in slot 1:
Related Commands
Command
|
Description
|
delete
|
Deletes a file on a Flash memory device.
|
dir
|
Displays a list of files on a file system.
|
undelete
|
Recovers a file marked "deleted" on a Class A or Class B Flash file system.
|
undelete
To recover a file marked "deleted" on a Class A or Class B Flash file system, use the undelete EXEC command.
undelete index [filesystem:]
Syntax Description
index
|
Number that indexes the file in the dir command output.
|
filesystem:
|
(Optional) File system containing the file to undelete.
|
Defaults
The default file system is the one specified by the cd command.
Command Modes
EXEC
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
For Class A and B Flash file systems, when you delete a file, the Cisco IOS software simply marks the file as deleted, but it does not erase the file. This command allows you to recover a "deleted" file on a specified Flash memory device. You must undelete a file by its index because you could have multiple deleted files with the same name. For example, the "deleted" list could contain multiple configuration files with the name router-config. You undelete by index to indicate which of the many router-config files from the list to undelete. Use the dir command to learn the index number of the file you want to undelete.
You cannot undelete a file if a valid (undeleted) one with the same name exists. Instead, you first delete the existing file and then undelete the file you want. For example, if you had an undeleted version of the router-config file and you wanted to use a previous, deleted version instead, you could not simply undelete the previous version by index. You would first delete the existing router-config file and then undelete the previous router-config file by index. You can delete and undelete a file up to 15 times.
On Class A Flash file systems, if you try to recover the configuration file pointed to by the CONFIG_FILE environment variable, the system prompts you to confirm recovery of the file. This prompt reminds you that the CONFIG_FILE environment variable points to an undeleted file. To permanently delete all files marked "deleted" on a Flash memory device, use the squeeze command.
On Class B Flash file systems, you must use the erase command to recover any space taken up by deleted files.
Examples
The following example recovers the deleted file whose index number is 1 to the Flash memory card inserted in slot 0:
Related Commands
Command
|
Description
|
delete
|
Deletes a file on a Flash memory device.
|
dir
|
Displays a list of files on a file system.
|
squeeze
|
Permanently deletes Flash files by squeezing a Class A Flash file system.
|
verify
To verify the checksum of a file on a Flash memory file system, use the verify EXEC command.
verify filesystem:[file-url]
Syntax Description
filesystem:
|
Flash memory filesystem. For example flash: or slot0:.
|
file-url
|
URL of the file to verify. Generally this consists only of the filename, but you may also specify directories, separated by forward-slashes (/).
|
Defaults
The current working device is the default device.
Command Modes
EXEC
Command History
Release
|
Modification
|
11.0
|
This command was introduced.
|
Usage Guidelines
This command replaces the copy verify and copy verify flash commands.
Use the verify command to verify the checksum of a file before using it.
Each software image that is distributed on disk uses a single checksum for the entire image. This checksum is displayed only when the image is copied into Flash memory; it is not displayed when the image file is copied from one disk to another.
To display the contents of Flash memory, use the show flash command. The Flash contents listing does not include the checksum of individual files. To recompute and verify the image checksum after the image has been copied into Flash memory, use the verify command.

Note
The verify command only performs a check on the integrity of the file after it has been saved in the file system. It is possible for a corrupt image to be transferred to the router and saved in the file system without detection.
To verify that a Cisco IOS software image was not corrupted while it was transfered to the router, copy the image from where it is stored on your router to a Unix server. Also copy the same image from CCO (Cisco.com) to the same Unix server. (The name may need to be modified if you try to save the IOS image in the same directory as the image that you copied from the router.) Now run a Unix diff command on the two Cisco IOS software images. If there is no difference then the IOS image stored on the router has not been corrupted.
Examples
The following example verifies that the file named c7200-js-mz is on the Flash memory card inserted in slot 0:
1 -rw- 4720148 Aug 29 1997 17:49:36 hampton/nitro/c7200-j-mz
2 -rw- 4767328 Oct 01 1997 18:42:53 c7200-js-mz
5 -rw- 639 Oct 02 1997 12:09:32 rally
7 -rw- 639 Oct 02 1997 12:37:13 the_time
20578304 bytes total (3104544 bytes free)
tw3-7200-1# verify slot0:
Verify filename []? c7200-js-mz
The following example also verifies that the file named c7200-js-mz is on the Flash memory card inserted in slot 0:
slot0:c7200-js-mz slot0:rally slot0:hampton/nitro/c7200-j-mz slot0:the_time
Router# verify slot0:c7200-js-mz
Verified slot0:c7200-js-mz
Related Commands
Command
|
Description
|
cd
|
Changes the default directory or file system.
|
copy
|
Copies any file from a source to a destination, use the copy EXEC command.
|
dir
|
Displays a list of files on a file system.
|
pwd
|
Shows the current setting of the cd command.
|
show file systems
|
Lists available file systems.
|
write erase
The write erase command has been replaced by the erase nvam: command. Refer to the erase command in this chapter.
write terminal
The more system:running-config command replaces the write terminal command. Refer to the more command for further details.