Полезная информация

cc/td/doc/product/software/ios120/12cgcr/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 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.

Default

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

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.

Example

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

You can use the master indexes or search online to find documentation of related commands.

copy
delete
dir
pwd
show file systems
undelete

copy verify

The verify command replaces the copy verify command. Refer to the verify command.

copy verify flash

The verify command replaces the copy verify flash command. Refer to the verify command.

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

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.

Example

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

You can use the master indexes or search online to find documentation of related commands.

cd
dir
show bootvar
show running-config
undelete

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.

Default

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

Use the show (Flash file system) command to display more detail about the files in a particular file system.

Sample Displays

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

You can use the master indexes or search online to find documentation of related commands.

cd
delete
undelete

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

When a file system is erased, none of the files in the file system can be recovered.

The erase command can be used on Class B 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 the format command to format the 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

You can use the master indexes or search online to find documentation of related commands.

boot config
delete
more nvram:startup-config
show bootvar
undelete

erase startup-config

The erase nvram: command replaces the erase startup-config command and the write erase command. Refer to the erase command in this chapter.

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.

Default

alert

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

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.

Example

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.

format filesystem1: (Class C Flash file systems)
format [spare spare-number] filesystem1: [[filesystem2:][monlib-filename]] (Class A Flash file system)
Caution 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 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.

Default

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

Command Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

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.

Example

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

You can use the master indexes or search online to find documentation of related commands.

cd
copy
delete
show file systems (Flash file system)
show running-config
undelete

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.3 AA.

This command is only valid on Class C Flash file systems.

Example

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

kerberos srvtab remote

To retrieve a krb5 SRVTAB file from the specified host, use the kerberos srvtab remote global configuration command.

kerberos srvtab remote file-url

Syntax Description

file-url

TFTP URL of the SRVTAB file on the specified host.

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 11.2.

When you use the kerberos srvtab remote command to copy the SRVTAB file from the remote host (generally the KDC), it parses the information in this file and stores it in the router's running configuration in the kerberos srvtab entry format. The key for each SRVTAB entry is encrypted with the private Data Encryption Standard (DES) key if one is defined on the router. To ensure that the SRVTAB is available (does not need to be acquired from the KDC) when you reboot the router, use the copy system:running-config nvram:startup-config global configuration command to save the router's running configuration.

Example

The following example copies the SRVTAB file (scooter.cisco.com-new-srvtab) residing on bucket.cisco.com to the router:

kerberos srvtab remote tftp://bucket.cisco.com/scooter.cisco.com-new-srvtab

Related Commands

You can use the master indexes or search online to find documentation of related commands.

kerberos srvtab remote
key config-key

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.3 AA.

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.

Example

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

You can use the master indexes or search online to find documentation of related commands.

dir
rmdir

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.3 AA.

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.

Sample Displays

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

You can use the master indexes or search online to find documentation of related commands.

boot config
configure terminal
copy system:running-config nvram:startup-config
service compress-config
show bootvar
show system

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

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

You can use the master indexes or search online to find documentation of related commands.

cd
dir

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.3 AA.

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.3 AA.

This command is valid only on Class C Flash file systems.

Example

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

You can use the master indexes or search online to find documentation of related commands.

dir
mkdir

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.3 AA.

File descriptors are the internal representations of open files. You can use this command to see if another user has a file open.

Sample Display

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.3 AA.

Sample Display

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.3 AA.

Use this command to learn the names of the file systems your router supports.

Sample Display

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. See Table  5.

Flags

Permissions for file system. See Table  6.

Prefixes

Prefix for file system.

Table 22 describes file system types.


Table 22: Possible File System Types
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 23 describes file system flags.


Table 23: 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.

show running-config

The more system:running-config command replaces the show running-config command. Refer to the more command for further details.

show startup-config

The more nvram:startup-config command replaces the show startup-config command. Refer to the more command for further details.

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 Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.1.

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.

Example

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

You can use the master indexes or search online to find documentation of related commands.

delete
dir
undelete

tftp-server

To configure a router or a Flash memory device on the router as a TFTP server, use the tftp-server global configuration command. To remove a previously defined filename, use the no form of this command with the appropriate filename.

tftp-server {file-url | rom} [alias alt-filename] [access-list-number]
no tftp-server {file-url | rom}

Syntax Description

file-url

Location of the file that the TFTP server uses in answering TFTP read requests.

rom

Specifies TFTP service of a file in ROM.

alias

(Optional) Specifies an alternate name for the file that the TFTP server uses in answering TFTP read requests.

alt-filename

(Optional) Alternate name of the file that the TFTP server uses in answering TFTP read requests. A client of the TFTP server can use this alternate name in its read requests.

access-list-number

(Optional) Basic IP access list number. Valid values are 0 to 99.

Default

Disabled

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

This command replaces the tftp-server system command.

You can specify multiple filenames by repeating the tftp-server command. The system sends a copy of the system image contained in ROM or one of the system images contained in Flash memory to any client that issues a TFTP read request with this filename. On systems that contain a complete image in ROM, the system sends the ROM image if the requested filename is not found in Flash memory.

Images that run from ROM cannot be loaded over the network. Therefore, it does not make sense to use TFTP to offer the ROMs on these images.

On the Cisco 7000 family, the system sends a copy of the file contained on one of the Flash memory devices to any client that issues a TFTP read request with its filename.

Examples

In the following example, the system uses TFTP to send a copy of the version-10.3 file located in Flash memory in response to a TFTP read request for that file. The requesting host is checked against access list 22.

tftp-server flash:version-10.3 22

In the following example, the system uses TFTP to send a copy of the ROM image gs3-k.101 in response to a TFTP read request for the gs3-k.101 file:

tftp-server rom alias gs3-k.101

In the following example, the system uses TFTP to send a copy of the version-11.0 file in response to a TFTP read request for that file. The file is located on the Flash memory card inserted in slot 0.

tftp-server slot0:version-11.0

The following example enables a router to operate as a TFTP server. The source file c3640-i-mz is in the second partition of internal Flash memory:

tftp-server flash:2:dirt/gate/c3640-i-mz

Related Commands

You can use the master indexes or search online to find documentation of related commands.

access-list

tftp-server system

The tftp-server command replaces the tftp-server system command. For further information refer to the tftp-server command.

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.

Default

The default file system is the one specified by the cd command.

Command Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

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.

Example

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

You can use the master indexes or search online to find documentation of related commands.

delete
dir
squeeze

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.

Default

The current working device is the default device.

Command Mode

EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 11.0.

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

You can use the master indexes or search online to find documentation of related commands.

cd
copy
dir
pwd
show file systems (Flash file system)

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.


hometocprevnextglossaryfeedbacksearchhelp
Copyright 1989-1998 © Cisco Systems Inc.