cc/td/doc/product/software/ios121/121cgcr/fun_r
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Cisco IOS File System Commands

Cisco IOS File System Commands

This chapter describes the commands used to configure the Cisco IOS File System (IFS) feature.

For IFS configuration tasks, refer to the "Configuring the Cisco IOS File System" chapter in the Cisco IOS 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 or alias 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:

Router# pwd
bootflash:/
Router# cd slot0:
Router# pwd
slot0:/

Related Commands
Command Description

copy

Copies any file from a source to a destination, use the copy EXEC command.

delete

Deletes a file on a Flash memory device.

dir

Displays a list of files on a file system.

pwd

Displays the current setting of the cd command.

show file systems

Lists available file systems and their alias prefix names.

undelete

Recovers a file marked ``deleted'' on a Class A or Class B Flash file system.

configure network

The copy source-url system:running-config command replaces the configure network command. See the description of the copy command for more information.

copy

To copy any file from a source to a destination, use the copy EXEC command.

copy [/erase] source-url destination-url

Syntax Description

/erase

(Optional) Erases the destination file system before copying.

source-url

The location URL or alias of the source file or directory to be copied.

destination-url

The destination URL or alias of the copied file or directory.

The exact format of the source and destination URLs varies according to the file or directory location. You may enter either a alias keyword for a particular file or a alias keyword for a file system type (not a file within a type).

Table 13 specifies two keyword shortcuts to URLs.


Table 13: Common Keyword Aliases to URLs
Keyword Source or Destination

running-config

(Optional) Keyword alias for the system:running-config command, the current running configuration file. This keyword does not work in more and show file command syntaxes.

startup-config

(Optional) Keyword alias for the nvram:startup-config command, the configuration file used for initialization. This file is contained in NVRAM for all platforms except the Cisco 7000 family, which uses the CONFIG_FILE environment variable to specify the startup configuration. The Cisco 4500 series cannot use the copy running-config startup-config command. This keyword does not work in more and show file command syntaxes.

The next tables list aliases by file system type. If you do not specify a alias, the router looks for a file in the current directory.

Table 14 lists URL aliases for Special (opaque) file systems.Table 15 lists them for network file systems, and Table 16 lists them for local writable storage.


Table 14: URL Prefix Aliases for Special File Systems
Alias Source or Destination

flh:

Source URL for flash load helper log files.

modem:

Destination url for loading modem firmware on Cisco 5200 and 5300 Series routers.

nvram:

Router's NVRAM. You can copy the startup configuration into or from NVRAM. You can also display the size of a private configuration file.

null:

Null destination for copies or files. You can copy a remote file to null to determine its size.

system:

Source or destination URL for system memory, which includes the running configuration.

xmodem:

Source destination for the file from a network machine that uses the Xmodem protocol.

ymodem:

Source destination for the file from a network machine that uses the Xmodem protocol.


Table 15: URL Prefix Aliases for Network File Systems
Alias Source or Destination

ftp:

Source or destination URL for File Transfer Protocol (FTP) network server. The syntax for this alias is
ftp:[[//username [:password]@] location]/directory]/filename.

rcp:

Source or destination URL for a Remote Copy Protocol (rcp) network server. The syntax for this alias is rcp:[[//username@]location]/directory]/filename.

tftp:

Source or destination URL for a Trivial File Transfer Protocol (TFTP) network server. The syntax for this alias is tftp:[[//location]/directory]/filename.


Table 16: URL Prefix Aliases for Local Writable Storage File Systems
Alias Source or Destination

bootflash:

Source or destination URL for boot flash memory.

disk0: and disk1:

Source or destination URL of rotating media.

flash:

Source or destination URL for Flash memory. This alias is available on all platforms. For platforms which lack a flash: device, note that flash: is aliased to slot0:, allowing you to refer to the main Flash memory storage area on all platforms.

slavebootflash:

Source or destination URL for internal Flash memory on the slave RSP card of a router configured for HSA.

slaveram:

NVRAM on a slave RSP card of a router configured for HSA.

slaveslot0:

Source or destination URL of first PCMCIA card on a slave RSP card of a router configured for HSA.

slaveslot1:

Source or destination URL of second PCMCIA slot on a slave RSP card of a router configured for HSA.

slot0:

Source or destination URL of first PCMCIA Flash memory card.

slot1:

Source or destination URL of second PCMCIA Flash memory card.

Command Modes

EXEC

Command History
Release Modification

11.3 T

This command was introduced.

Usage Guidelines

You can enter on the command line all necessary source- and destination-URL information and the username and password to use, or you can enter copy and have the router prompt you for any missing information.

If you enter information, choose one of the following three: running-config, startup-config, or a file system alias (see tables above.) The location of a file system dictates the format of the source or destination URL.

The colon is required after the alias. However, earlier commands, not requiring a colon, will remain supported, but unavailable in context-sensitive help.

The entire copying process may take several minutes and differs from protocol to protocol and from network to network.

In the alias syntax for ftp:, rcp:, and tftp: the location is either an IP address or a host name. The filename is specified relative to the directory used for file transfers.

This section contains usage guidelines for the following topics:

Understanding Invalid Combinations of Source and Destination

Some invalid combinations of source and destination exist. Specifically, you cannot copy the following:

Understanding Character Descriptions

Table 33 describes the characters that you may see during processing of the copy command.


Table 17: copy Character Descriptions
Character Description

!

For net transfers, an exclamation point indicates that the copy process is taking place. Each exclamation point indicates the successful transfer of ten packets (512 bytes each).

.

For net transfers, a period indicates that the copy process timed out. Many periods in a row typically mean that the copy process may fail.

O

For net transfers, an uppercase O indicates that a packet was received out of order and the copy process may fail.

e

For flash erasures, a lowercase e indicates that a device is being erased.

E

An uppercase E indicates an error. The copy process may fail.

V

A series of uppercase Vs indicates the progress during the verification of the image checksum.

Understanding Partitions

You cannot copy an image or configuration file to a Flash partition from which you are currently running. For example, if partition 1 is running the current system image, copy the configuration file or image to partition 2. Otherwise, the copy operation will fail.

You can identify the available Flash partitions by entering the show file system command.

Using rcp

The rcp protocol requires a client to send a remote username upon each rcp request to a server. When you copy a configuration file or image between the router and a server using rcp, the Cisco IOS software sends the first valid username in the following list:

    1. The remote username specified in the copy command, if one is specified.

    2. The username set by the ip rcmd remote-username command, if the command is configured.

    3. The remote username associated with the current tty (terminal) process. For example, if the user is connected to the router through Telnet and was authenticated through the username command, the router software sends the Telnet username as the remote username.

    4. The router host name.

For the rcp copy request to process successfully, an account must be defined on the network server for the remote username. If the network administrator of the destination server did not establish an account for the remote username, this command will not run successfully. If the server has a directory structure, the configuration file or image is written to or copied from the directory associated with the remote username on the server. For example, if the system image resides in the home directory of a user on the server, specify that user's name as the remote username.

If you are writing to the server, the rcp server must be properly configured to accept the rcp write request from the user on the router. For UNIX systems, add an entry to the .rhosts file for the remote user on the rcp server. Suppose the router contains the following configuration lines:

hostname Rtr1
ip rcmd remote-username User0
 

If the router's IP address translates to Router1.company.com, then the .rhosts file for User0 on the rcp server should contain the following line:

Router1.company.com Rtr1
 

Refer to the documentation for your rcp server for more details.

If you are using a personal computer as a file server, the computer must support rsh.

Using FTP

The FTP protocol requires a client to send a remote username and password upon each FTP request to a server. When you copy a configuration file from the router to a server using FTP, the Cisco IOS software sends the first valid username in the following list:

    1. The username specified in the copy command, if a username is specified.

    2. The username set by the ip ftp username command, if the command is configured.

    3. Anonymous.

The router send the first valid password in the following list:

    1. The password specified in the copy command, if a password is specified.

    2. The password set by the ip ftp password command, if the command is configured.

    3. The router forms a password username@routername.domain. The variable username is the username associated with the current session, routername is the configured host name, and domain is the domain of the router.

The username and password must be associated with an account on the FTP server. If you are writing to the server, the FTP server must be properly configured to accept the FTP write request from the user on the router.

If the server has a directory structure, the configuration file or image is written to or copied from the directory associated with the username on the server. For example, if the system image resides in the home directory of a user on the server, specify that user's name as the remote username.

Refer to the documentation for your FTP server for more details.

Use the ip ftp username and ip ftp password commands to specify a username and password for all copies. Include the username in the copy command if you want to specify a username for that copy operation only.

Storing Images on Servers

Use the copy flash: destination-url command (for example, copy flash: tftp:) to copy a system image or boot image from Flash memory to a network server. Use the copy of the image as a backup copy. Also, use it to verify that the copy in Flash memory is the same as that in the original file.

Copying from a Server to Flash Memory

Use the copy destination-url flash: command (for example, copy tftp: flash:) to copy an image from a server to Flash memory.

On Class B file system platforms, the system provides an option to erase existing Flash memory before writing onto it.


Caution Verify the image in Flash memory before booting the image.

Verifying Images

Before booting from Flash memory, verify that the checksum of the image in Flash memory matches the checksum listed in the README file that was distributed with the image by using the verify command. The checksum of the image in Flash memory is displayed when the copy command completes. The README file was copied to the server automatically when you installed the image.


Caution If the checksum values do not match, do not reboot the router. Instead, reissue the copy command and compare the checksums again. If the checksum is repeatedly wrong, copy the original image back into Flash memory before you reboot the router from Flash memory. If you have a corrupted image in Flash memory and try to boot from Flash memory, the router will start the system image contained in ROM (assuming booting from a network server is not configured). If ROM does not contain a fully functional system image, the router might not function and will have to be reconfigured through a direct console port connection.

Copying a Configuration File from a Server to the Running Configuration

Use the copy {ftp: | rcp: | tftp:} system:running-config command to load a configuration file from a network server to the running configuration of the router. The configuration will be added to the running configuration as if the commands were typed in the command line interface. Thus, the resulting configuration will be a combination of the previous running configuration and the loaded configuration file, with the loaded configuration file having precedence.

You can copy either a host configuration file or a network configuration file. Accept the default value of host to copy and load a host configuration file containing commands that apply to one network server in particular. Enter network to copy and load a network configuration file containing commands that apply to all network servers on a network.

Copying a Configuration File from a Server to the Startup Configuration

Use the copy {ftp: | rcp: | tftp:} nvram:startup-config command to copy a configuration file from a network server to the router's startup configuration. These commands replace the startup configuration file with the copied configuration file.

Storing the Running or Startup Configuration on a Server

Use the copy system:running-config {ftp: | rcp: | tftp:} command to copy the current configuration file to a network server using FTP, rcp, or TFTP. Use the copy nvram:startup-config {ftp: | rcp: | tftp:} command to copy the startup configuration file to a network server.

The configuration file copy can serve as a backup copy.

Saving the Running Configuration to the Startup Configuration

Use the copy system:running-config nvram:startup-config command to copy the running configuration to the startup configuration.


Caution Some specific commands might not get saved to NVRAM. You will have to enter these commands again if you reboot the machine. These commands are noted in the documentation. We recommend that you keep a listing of these settings so you can quickly reconfigure your router after rebooting.

If you issue the copy system:running-config nvram:startup-config command from a bootstrap system image, a warning will instruct you to indicate whether you want your previous NVRAM configuration to be overwritten and configuration commands to be lost. This warning does not appear if NVRAM contains an invalid configuration or if the previous configuration in NVRAM was generated by a bootstrap system image.

On all platforms except Class A file system platforms, the copy system:running-config nvram:startup-config command copies the currently running configuration to NVRAM.

On the Class A Flash file system platforms, the copy system:running-config nvram:startup-config command copies the currently running configuration to the location specified by the CONFIG_FILE environment variable. This variable specifies the device and configuration file used for initialization. When the CONFIG_FILE environment variable points to NVRAM or when this variable does not exist (such as at first-time startup), the software writes the current configuration to NVRAM. If the current configuration is too large for NVRAM, the software displays a message and stops executing the command.

When the CONFIG_FILE environment variable specifies a valid device other than nvram: (that is, flash:, bootflash:, slot0:, or slot1:), the software writes the current configuration to the specified device and filename and stores a distilled version of the configuration in NVRAM. A distilled version is one that does not contain access list information. If NVRAM already contains a copy of a complete configuration, the router prompts you to confirm the copy.

Using CONFIG_FILE, BOOT, and BOOTLDR Environment Variables

For the Class A Flash file system platforms:

To view the contents of environment variables, use the show bootvar command. To modify the CONFIG_FILE environment variable, use the boot config command. To modify the BOOTLDR environment variable use the boot bootldr command. To modify the BOOT environment variable, use the boot system command. To save your modifications, use the copy system:running-config nvram:startup-config command.

When the destination of a copy command is specified by the CONFIG_FILE or BOOTLDR environment variable, the router prompts you for confirmation before proceeding with the copy. When the destination is the only valid image in the BOOT environment variable, the router also prompts you for confirmation before proceeding with the copy.

Understanding High System Availability

High System Availability (HSA) refers to how quickly your router returns to an operational status after a failure occurs. On the Cisco 7507 and Cisco 7513, you can install two RSP cards in a single router to improve system availability.

On a Cisco 7507 or Cisco 7513 configured for HSA, if you copy a file to nvram:startup-configuration with automatic synchronization disabled, the system asks you if you also want to copy the file to the slave's startup configuration. The default answer is yes. If automatic synchronization is enabled, the system automatically copies the file to the slave's startup configuration each time you use a copy command with nvram:startup-configuration as the destination.

Examples

The following examples illustrate uses of the copy command. Depending on your platform, the output might be different from that shown in the examples.

Copy an Image from a Server to Flash Memory Examples

The following three examples use a copy rcp:, copy tftp:, or copy ftp: command to copy an image from a server to Flash memory.

Copy an Image from a Server to Flash Memory Example

This example copies a system image named file1 from the remote rcp server with an IP address of 172.16.101.101 to Flash memory. On Class B file system platforms, the Cisco IOS software allows you to erase the contents of Flash memory first to ensure that enough Flash memory is available to accommodate the system image.

Router# copy rcp://netadmin@172.16.101.101/file1 flash:file1 
Destination file name [file1]?
Accessing file 'file1' on 172.16.101.101...
Loading file1 from 172.16.101.101 (via Ethernet0): ! [OK]
 
Erase flash device before writing? [confirm]
Flash contains files. Are you sure you want to erase? [confirm]
 
Copy 'file1' from server
  as 'file1' into Flash WITH erase? [yes/no] yes
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...erased
Loading file1 from 172.16.101.101 (via Ethernet0): !
[OK - 984/8388608 bytes]
 
Verifying checksum... OK (0x14B3)
Flash copy took 0:00:01 [hh:mm:ss]
 

Copy from a Server to a Flash Memory Using Flash Load Helper Example

The following example copies a system image into a partition of Flash memory. The system will prompt for a partition number only if there are two or more read/write partitions or one read-only and one read/write partition and dual Flash bank support in boot ROMs. If the partition entered is not valid, 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. In this case, the partition is read-only and has dual Flash bank support in boot ROM, so the system uses Flash Load Helper.

Router# copy tftp: flash:
 
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]
 
                               **** NOTICE ****
Flash load helper v1.0
This process will accept the copy options and then terminate
the current system image to use the ROM based image for the copy.
Routing functionality will not be available during that time.
If you are logged in via telnet, this connection will terminate.
Users with console access can see the results of the copy operation.
                               ---- ******** ----
Proceed? [confirm]
System flash directory, partition 1:
File  Length   Name/status
  1   3459720  master/igs-bfpx.100-4.3
[3459784 bytes used, 734520 available, 4194304 total]
Address or name of remote host [255.255.255.255]? 172.16.1.1
Source file name? master/igs-bfpx-100.4.3
Destination file name [default = source name]?
 
Loading master/igs-bfpx.100-4.3 from 172.16.1.111: !
Erase flash device before writing? [confirm]
Flash contains files. Are you sure? [confirm]
Copy 'master/igs-bfpx.100-4.3' from TFTP server
as 'master/igs-bfpx.100-4.3' into Flash WITH erase? [yes/no] yes

Copy an Image from a Server to a Flash Memory Card Partition Example

The following example copies the file c3600-i-mz from the rcp server at IP address 172.23.1.129 to the Flash memory card in slot 0 of a Cisco 3600 series router, which has only one partition. As the operation progresses, the Cisco IOS software asks you to erase the files on the Flash memory PC card to accommodate the incoming file. This entire operation takes 18 seconds to perform, as indicated at the end of the example.

Router# copy rcp: slot0:
PCMCIA Slot0 flash
 
Partition   Size    Used      Free      Bank-Size  State          Copy Mode
  1         4096K   3068K     1027K     4096K      Read/Write     Direct
  2         4096K   1671K     2424K     4096K      Read/Write     Direct
  3         4096K      0K     4095K     4096K      Read/Write     Direct
  4         4096K   3825K      270K     4096K      Read/Write     Direct
 
[Type ?<no> for partition directory; ? for full directory; q to abort]
Which partition? [default = 1] 
 
PCMCIA Slot0 flash directory, partition 1:
File  Length   Name/status
  1   3142288  c3600-j-mz.test  
[3142352 bytes used, 1051952 available, 4194304 total]
Address or name of remote host [172.23.1.129]? 
Source file name? /tftpboot/images/c3600-i-mz
Destination file name [/tftpboot/images/c3600-i-mz]? 
Accessing file '/tftpboot/images/c3600-i-mz' on 172.23.1.129...
Connected to 172.23.1.129
Loading 1711088 byte file c3600-i-mz: ! [OK]
 
Erase flash device before writing? [confirm]
Flash contains files. Are you sure you want to erase? [confirm]
 
Copy '/tftpboot/images/c3600-i-mz' from server
  as '/tftpboot/images/c3600-i-mz' into Flash WITH erase? [yes/no] yes
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Connected to 172.23.1.129
Loading 1711088 byte file c3600-i-mz: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Verifying checksum...  OK (0xF89A)
Flash device copy took 00:00:18 [hh:mm:ss]

Save a Copy of an Image on a Server Examples

The following four examples use copy commands to copy images to a server for storage.

Copy an Image from Flash Memory to an rcp Server Example

The following example copies a system image from Flash Memory to an rcp server using the default remote username. Because the rcp server address and filename are not included in the command, the router prompts for it.

Router# copy flash: rcp:
IP address of remote host [255.255.255.255]? 172.16.13.110
Name of file to copy? gsxx
writing gsxx - copy complete
 

Copy an Image from a Partition of Flash Memory to a Server Example

The following example copies an image from a particular partition of Flash memory to an rcp server using a remote username of netadmin1.

The system will prompt if there are two or more partitions. If the partition entered is not valid, the process terminates. You have the option to enter a partition number, a question mark (?) for a directory display of all partitions, or a question mark and a number (?number) for a directory display of a particular partition. The default is the first partition.

Router# configure terminal
Router# ip rcmd remote-username netadmin1
Router# end
Router# copy flash: rcp:
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 ?<number> for partition directory; ? for full directory; q to abort]
Which partition? [1] 2
 
System flash directory, partition 2:
File  Length   Name/status
  1   3459720  master/igs-bfpx.100-4.3
[3459784 bytes used, 734520 available, 4194304 total]
Address or name of remote host [ABC.CISCO.COM]?
Source file name? master/igs-bfpx.100-4.3
Destination file name [master/igs-bfpx.100-4.3]?
Verifying checksum for 'master/igs-bfpx.100-4.3' (file # 1)... OK
Copy 'master/igs-bfpx.100-4.3' from Flash to server
as 'master/igs-bfpx.100-4.3'? [yes/no] yes
!!!!...
Upload to server done
Flash copy took 0:00:00 [hh:mm:ss]
 

Copy an Image from a Flash Memory File System to an FTP Server

The following example copies the file c3600-i-mz from partition 1 of the Flash memory card in slot 0 to an FTP server at IP address 172.23.1.129.

Router# show slot0: partition 1
 
PCMCIA Slot0 flash directory, partition 1:
File  Length   Name/status
  1   1711088 c3600-i-mz 
[1711152 bytes used, 2483152 available, 4194304 total]
 
Router# copy slot0:1:c3600-i-mz ftp://myuser:mypass@172.23.1.129/c3600-i-mz
Verifying checksum for '/tftpboot/cisco_rules/c3600-i-mz' (file # 1)...  OK
Copy '/tftpboot/cisco_rules/c3600-i-mz' from Flash to server
  as 'c3700-i-mz'? [yes/no] yes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Upload to server done
Flash device copy took 00:00:23 [hh:mm:ss]
 

Copy an Image from Boot Flash Memory to a TFTP Server

The following example copies an image from boot Flash memory to a TFTP server:

Router# copy bootflash:file1 tftp://192.168.117.23/file1
 
Verifying checksum for 'file1' (file # 1)... OK
Copy 'file1' from Flash to server
  as 'file1'? [yes/no]y
!!!!...
Upload to server done
Flash copy took 0:00:00 [hh:mm:ss]

Copy from a Server to the Running Configuration Example

The following example copies and runs a configuration filename host1-confg from the netadmin1 directory on the remote server with an IP address of 172.16.101.101:

Router# copy rcp://netadmin1@172.16.101.101/host1-confg system:running-config 
Configure using host1-confg from 172.16.101.101? [confirm]
Connected to 172.16.101.101
Loading 1112 byte file host1-confg:![OK]
Router#
%SYS-5-CONFIG: Configured from host1-config by rcp from 172.16.101.101

Copy from a Server to the Startup Configuration Example

The following example copies a configuration file host2-confg from a remote FTP server to the startup configuration. The IP address is172.16.101.101; the remote username is netadmin1; and the remote password is ftppass.

Router# copy ftp://netadmin1:ftppass@172.16.101.101/host2-confg nvram:startup-config 
Configure using rtr2-confg from 172.16.101.101?[confirm]
Connected to 172.16.101.101
Loading 1112 byte file rtr2-confg:![OK]
[OK]
Router#
%SYS-5-CONFIG_NV:Non-volatile store configured from rtr2-config by 
FTP from 172.16.101.101

Copy the Running Configuration to a Server Example

The following example specifies a remote username of netadmin1. Then it copies the running configuration file, named Rtr2-confg, to the netadmin1 directory on the remote host with an IP address of 172.16.101.101.

Router# configure terminal
Router(config)# ip rcmd remote-username netadmin1
Router(config)# end
Router# copy system:running-config rcp:
Remote host[]? 172.16.101.101
 
Name of configuration file to write [Rtr2-confg]?
Write file rtr2-confg on host 172.16.101.101?[confirm]
Building configuration...[OK]
Connected to 172.16.101.101

Copy the Startup Configuration to a Server Example

The following example copies the startup configuration to a TFTP server:

Router# copy nvram:startup-config tftp:
Remote host[]? 172.16.101.101
 
Name of configuration file to write [rtr2-confg]? <cr>
Write file rtr2-confg on host 172.16.101.101?[confirm] <cr>
![OK]

Save the Current Running Configuration Example

The following example copies the running configuration to the startup configuration. On a Class A Flash file system platform, this command copies the running configuration to the startup configuration specified by the CONFIG_FILE variable.

copy system:running-config nvram:startup-config
 

The following example shows the warning the system provides if you try to save configuration information from bootstrap into the system:

Router(boot)# copy system:running-config nvram:startup-config 
 
Warning: Attempting to overwrite an NVRAM configuration written
by a full system image. This bootstrap software does not support
the full configuration command set. If you perform this command now,
some configuration commands may be lost.
Overwrite the previous NVRAM configuration?[confirm]
 

Enter no to escape writing the configuration information to memory.

Move Configuration Files to Other Locations Examples

On some routers, you can store copies of configuration files on a Flash memory device. Five examples follow:

Copy the Startup Configuration to a Flash Memory Device Example

The following example copies the startup configuration file (specified by the CONFIG_FILE environment variable) to a Flash memory card inserted in slot 0:

copy nvram:startup-config slot0:router-confg
 

Copy the Running Configuration to a Flash Memory Device Example

The following example copies the running configuration from the router to the Flash memory PC card in slot 0:

Router# copy system:running-config slot0:karen2
Building configuration...
 
5267 bytes copied in 0.720 secs
 

Copy to the Running Configuration from a Flash Memory Device Example

The following example copies the file ios-upgrade-1 from the Flash memory card in slot 0 to the running configuration:

Router# copy slot0:4:ios-upgrade-1 system:running-config
 
Copy 'ios-upgrade-1' from flash device
  as 'running-config' ? [yes/no] yes
 

Copy to the Startup Configuration from a Flash Memory Device Example

The following example copies the router-image file from the Flash memory to the startup configuration:

copy flash:router-image nvram:startup-config
 

Copy a Configuration File from one Flash Device to Another Example

This example copies the file running-config from the first partition in internal Flash memory to the Flash memory PC card in slot 1. The checksum of the file is verified, and its copying time of 30 seconds is displayed.

Router# copy flash: slot1:
System flash
 
Partition   Size    Used      Free      Bank-Size  State          Copy Mode
  1         4096K   3070K     1025K     4096K      Read/Write     Direct
  2        16384K   1671K    14712K     8192K      Read/Write     Direct
 
[Type ?<no> for partition directory; ? for full directory; q to abort]
Which partition? [default = 1] 
 
System flash directory, partition 1: 
File  Length   Name/status
  1   3142748  dirt/images/mars-test/c3600-j-mz.latest 
  2   850      running-config 
[3143728 bytes used, 1050576 available, 4194304 total]
 
PCMCIA Slot1 flash directory:
File  Length   Name/status
  1   1711088  dirt/images/c3600-i-mz 
  2   850      running-config 
[1712068 bytes used, 2482236 available, 4194304 total]
Source file name? running-config 
Destination file name [running-config]? 
Verifying checksum for 'running-config' (file # 2)...  OK
Erase flash device before writing? [confirm] 
Flash contains files. Are you sure you want to erase? [confirm] 
 
Copy 'running-config' from flash: device
  as 'running-config' into slot1: device WITH erase? [yes/no] yes
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
!
 [OK - 850/4194304 bytes]
 
Flash device copy took 00:00:30 [hh:mm:ss]
Verifying checksum...  OK (0x16)

Copy an Image from the Master RSP Card to the Slave RSP Card Example

The following example copies the router-image file from the Flash memory card inserted in slot 1 of the master RSP card to slot 0 of the slave RSP card in the same router:

copy slot1:router-image slaveslot0:

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.

boot system

Specifies the system image that the router loads at startup.

cd

Changes the default directory or file system.

copy xmodem: flash:

Copies any file from a source to a destination, use the copy EXEC command.

copy ymodem: flash:

Copies any file from a source to a destination, use the copy EXEC command.

delete

Deletes a file on a Flash memory device.

dir

Displays a list of files on a file system.

erase

Erases a file system.

ip rcmd remote-username

Configures the remote username to be used when requesting a remote copy using rcp.

reload

Reloads the operating 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.

show file systems

Displays the layout and contents of a Flash memory file system.

slave auto-sync config

Turns on automatic synchronization of configuration files for a Cisco 7507 or Cisco 7513 that is configured for HSA.

verify bootflash:

Either of the identical verify bootflash: or verify bootflash commands replaces the copy verify bootflash command. Refer to the verify command for more information.

erase bootflash

The erase bootflash: and erase bootflash commands have identical function. See the erase command for more information.

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 (Flash file system) command to display more detail about the files in a particular file system.

Examples

The following is sample output from the dir command:

Router# dir slot0:
Directory of slot0:/
 
  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)
 
Router# dir /all slot0:
Directory of slot0:/
 
  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 18 described the fields shown in these displays.


Table 18: 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. Fopr example, flash: or nvram:

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:

erase nvram:
 

The following example erases all of partition 2 in internal Flash memory:

Router# erase flash:2   
 
System flash directory, partition 2:
File  Length   Name/status
  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:

Router# erase flash:
 
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:
File  Length   Name/status
  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:

file prompt noisy

format

To format a Class A or Class C Flash file system, use the format EXEC command.

Class C Flash file system

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, in case you must reformat the Flash memory card. If you fail to specify spare sectors, all existing data will be erased.

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 the filesystem1 argument. The default monlib file is the one bundled with the system software.

When used with HSA and you do not specify the monlib-filename argument, the system takes ROM monitor library file from the slave image bundle. If you specify the monlib-filename argument, the system assumes that the files reside on the slave devices.

Defaults

The default monlib file is the one bundled with the system software.

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 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:

Router# format slot0:
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:

Router# fsck flash:
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.
Fsck of flash: complete

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:

Router# mkdir newdir
Mkdir file name [newdir]?
Created dir flash:newdir
Router# dir
Directory of flash:
 
  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.

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.

You can use this command to display configuration files:

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
!
version 11.3
service timestamps debug uptime
service timestamps log uptime
service password-encryption
service udp-small-servers
service tcp-small-servers
...
end
 

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
!
version 11.3 
service compress-config
!
hostname rose
!
...
 

The following partial sample output displays the running configuration:

Router2# more system:running-config
Building configuration...
 
Current configuration:
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname Router2
!
...
!
end

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:

Router> pwd
slot0:/
 

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:

Router> cd slot1:
Router> pwd
slot1:/

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:

Router# dir
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
Router# dir
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:

Router# dir
Directory of flash:
 
  2  drwx           0   Mar 13 1993 13:16:21  newdir
 
8128000 bytes total (8126976 bytes free)
Router# rmdir newdir
Rmdir file name [newdir]?
Delete flash:newdir? [confirm]
Removed dir flash:newdir
Router# dir
Directory of flash:
 
No files in directory
 
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
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 19 describes the fields show in this display.


Table 19: 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] 
  Foreign image
 
Router# show file information slot0:c7200-js-mz
slot0:c7200-js-mz:
  type is image (elf) []
  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
nvram:startup-config:
  type is ascii text
 
 

Table 20 describes the possible file types.


Table 20: 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 alias names (Prefixes) of the file systems your router supports.

Examples

The following is sample output from the show file systems command:

Router# show file systems
 
File Systems:
  
     Size(b)        Free(b)   Type     Flags  Prefixes
           -           -    opaque     rw     null:
           -           -    opaque     rw     system:
           -           -    opaque     ro     xmodem:
           -           -    opaque     ro     ymodem:
           -           -   network     rw     tftp:
           -           -   network     rw     rcp:
           -           -   network     rw     ftp:
*    4194304     4190616     flash     rw     flash:
      131066      129185     nvram     rw     nvram:
           -           -    opaque     wo     lex:
 
 

Table 21 describes the fields shown in this display.


Table 21: 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

Alias 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, and so on.).

nvram

The file system is for an NVRAM device.

opaque

The file system is a locally generated "pseudo" file system for example, 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 22 describes file system flags.


Table 22: 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:

squeeze slot1:

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:

undelete 1 slot0:

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 file-url

Syntax Description

file-url

URL of the file to verify.

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.

The README file, which is included with the image on the disk, lists the name, file size, and checksum of the image. Review the contents of the README file before loading or duplicating the new image so that you can verify the checksum when you copy it into Flash memory or onto a server.

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.

Examples

The following example verifies that the file named c7200-js-mz is on the Flash memory card inserted in slot 0:

Router# dir slot0:
Directory of slot0:/
 
  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
Verified slot0:
 

The following example also verifies that the file named c7200-js-mz is on the Flash memory card inserted in slot 0:

Router# verify slot0:?
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

Displays the current setting of the cd command.

show file systems (Flash file system)

Lists available file systems.

write erase

The erase nvam: command replaces the write erase command. See the erase command in this chapter for more information.

write terminal

The more system:running-config command replaces the write terminal command. See the more command in this chapter for more information.


hometocprevnextglossaryfeedbacksearchhelp
Posted: Thu Mar 30 15:21:44 PST 2000
Copyright 1989 - 2000©Cisco Systems Inc.