The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
The flash file system is a single flash device on which you can store files. It also provides several commands to help you
manage software bundles and configuration files. The default flash file system on the device is named flash:.
As viewed from the active device, flash: refers to the local flash device, which is the device attached to the same device
on which the file system is being viewed. In a device stack, each of the flash devices from the various stack members can be viewed from the active device. The names
of these flash file systems include the corresponding device member numbers. For example, flash-3:, as viewed from the active
device, refers to the same file system as does flash: on stack member 3. Use the show file systems privileged EXEC command to list all file systems, including the flash file systems in the device stack.
Only one user at a time can manage the software bundles and configuration files for a device stack.
Displaying Available File Systems
To display the available file systems on your device, use the show file systems privileged EXEC command as shown in this example for a standalone device:
Table 1. show file systems Field Descriptions
Field
Value
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.
disk—The file system is for a flash memory device, USB flash, and crashinfo file.
network—The file system for network devices; for example, an FTP server or and HTTP server.
nvram—The file system is for a NVRAM device.
opaque—The file system is a locally generated pseudo file system (for example, the system) or a download interface, such as brimux.
unknown—The file system is an unknown type.
Flags
Permission for file system.
ro—read-only.
rw—read/write.
wo—write-only.
Prefixes
Alias for file system.
crashinfo:—Crashinfo file.
flash:—Flash file system.
ftp:—FTP server.
http:—HTTP server.
https:—Secure HTTP server.
nvram:—NVRAM.
null:—Null destination for copies. You can copy a remote file to null to find its size.
rcp:—Remote Copy Protocol (RCP) server.
scp:—Session Control Protocol (SCP) server.
system:—Contains the system memory, including the running configuration.
tftp:—TFTP network server.
usbflash0:—USB flash memory.
ymodem:—Obtain the file from a network machine by using the Ymodem protocol.
Setting the Default File System
You can specify the file system or directory that the system uses as the default file system by using the cdfilesystem: privileged EXEC command. You can set the default file system to omit the filesystem: argument from related commands. For example, for all privileged EXEC commands that have the optional filesystem: argument, the system uses the file system specified by the cd command.
By default, the default file system is flash:.
You can display the current default file system as specified by the cd command by using the pwd privileged EXEC command.
Displaying Information About Files on a File System
You can view a list of the contents of a file system before manipulating its contents. For example, before copying a new configuration
file to flash memory, you might want to verify that the file system does not already contain a configuration file with the
same name. Similarly, before copying a flash configuration file to another location, you might want to verify its filename
for use in another command. To display information about files on a file system, use one of the privileged EXEC commands listed
in the following table.
Table 2. Commands for Displaying Information About Files
Command
Description
dir [/all] [filesystem:filename]
Displays a list of files on a file system.
show file systems
Displays more information about each of the files on a file system.
show file informationfile-url
Displays information about a specific file.
show file descriptors
Displays a list of open file descriptors. File descriptors are the internal representations of open files. You can use this
command to see if another user has a file open.
For example, to display a list of all files in a file system, use the dir privileged EXEC command:
Changing Directories and Displaying the Working Directory
Follow these steps to change directories and to display the working directory:
Procedure
Command or Action
Purpose
Step 1
enable
Example:
Device> enable
Enables privileged EXEC mode.
Enter your password if prompted.
Step 2
dirfilesystem:
Example:
Device# dir flash:
Displays the directories on the specified file system.
For filesystem:, use flash: for the system board flash device.
Step 3
cddirectory_name
Example:
Device# cd new_configs
Navigates to the specified directory.
The command example shows how to navigate to the directory named new_configs.
Step 4
pwd
Example:
Device# pwd
Displays the working directory.
Step 5
cd
Example:
Device# cd
Navigates to the default directory.
Creating Directories
Beginning in privileged EXEC mode, follow these steps to create a directory:
Procedure
Command or Action
Purpose
Step 1
dirfilesystem:
Example:
Device# dir flash:
Displays the directories on the specified file system.
For filesystem:, use flash: for the system board flash device.
Step 2
mkdirdirectory_name
Example:
Device# mkdir new_configs
Creates a new directory. Directory names are case sensitive and are limited to 45 characters between the slashes (/); the
name cannot contain control characters, spaces, slashes, quotes, semicolons, or colons.
Step 3
dirfilesystem:
Example:
Device# dir flash:
Verifies your entry.
Removing Directories
To remove a directory with all its files and subdirectories, use the delete /force /recursivefilesystem:/file-url privileged EXEC command.
Use the /recursive keyword to delete the named directory and all subdirectories and the files contained in it. Use the /force keyword to suppress the prompting that confirms a deletion of each file in the directory. You are prompted only once at the
beginning of this deletion process.
For filesystem, use flash: for the system board flash device. For file-url, enter the name of the directory to be deleted. All of the files in the directory and the directory are removed.
Caution
When directories are deleted, their contents cannot be recovered.
Copying Files
To copy a file from a source to a destination, use the copy source-url destination-url privileged EXEC command. For the source and destination URLs, you can use running-config and startup-config keyword shortcuts. For example, the copy running-config startup-config command saves the currently running configuration file to the NVRAM section of flash memory to be used as the configuration
during system initialization.
You can also copy from special file systems (xmodem:, ymodem:) as the source for the file from a network machine that uses the Xmodem or Ymodem protocol. SSH File Transfer Protocol (SFTP)
is also another option to copy switch configuration or image files. For more information, refer the Configuring SSH File Transfer Protocol chapter of the Security Configuration Guide.
Network file system URLs include ftp:, rcp:, tftp:, scp:, http:, and https: and have these syntaxes:
The password must not contain the special character '@'. If the character '@' is used, the copy fails to parse the IP address
of the server.
Local writable file systems include flash:.
Some invalid combinations of source and destination exist. Specifically, you cannot copy these combinations:
From a running configuration to a running configuration
From a startup configuration to a startup configuration
Copying Files from One Device in a Stack to Another Device in the Same Stack
To copy a file from one device in a stack to another device in the same stack, use the flash-X: notation, where X is the device number.
To view all devices in a stack, use the show switch command in privileged EXEC mode, as in the following example of a 9-member device stack:
Device# show switch
Switch/Stack Mac Address : 0006.f6b9.b580 - Local Mac Address Mac persistency wait time: Indefinite
H/W Current
Switch# Role Mac Address Priority Version State
------------------------------------------------------------
*1 Active 0006.f6b9.b580 15 P3B Ready
2 Standby 0006.f6ba.0c80 14 P3B Ready
3 Member 0006.f6ba.3300 7 P3B Ready
4 Member 0006.f6b9.df80 6 P3B Ready
5 Member 0006.f6ba.3880 13 P1A Ready
6 Member 1ce6.c7b6.ef00 4 PP Ready
7 Member 2037.06ce.2580 3 P2A Ready
8 Member 2037.0653.7e00 2 P5A Ready
9 Member 2037.0653.9280 1 P5B Ready
To view all devices in a stack, use the show switch command in privileged EXEC mode, as in the following example of a 8-member device stack:
Device# show switch
Switch/Stack Mac Address : 046c.9d01.3b80 - Local Mac Address
Mac persistency wait time: 4 mins
H/W Current
Switch# Role Mac Address Priority Version State
------------------------------------------------------------
*1 Active 046c.9d01.3b80 15 P4B Ready
2 Standby 046c.9d01.0f80 13 P3C Ready
3 Member 046c.9d01.1180 11 P4B Ready
4 Member 046c.9d01.0e80 9 P3C Ready
5 Member 046c.9d01.4d00 7 P3C Ready
6 Member 046c.9d01.2800 5 P3C Ready
7 Member 046c.9d01.6e80 3 P4B Ready
8 Member 046c.9d01.8180 1 P4B Ready
To view all file systems available to copy on a specific device, use the copy command as in the following example of a 5-member stack:
This example shows how to copy a config file stored in the flash partition of device 2 to the flash partition of device 4.
It assumes that device 2 and device 4 are in the same stack.
When you no longer need a file on a flash memory device, you can permanently delete it. To delete a file or directory from
a specified flash device, use the delete [/force] [/recursive] [filesystem:]/file-url privileged EXEC command.
Use the /recursive keyword for deleting a directory and all subdirectories and the files contained in it. Use the /force keyword to suppress the prompting that confirms a deletion of each file in the directory. You are prompted only once at the
beginning of this deletion process. Use the /force and /recursive keywords for deleting old software images that were installed by using the archive download-sw command but are no longer needed.
If you omit the filesystem: option, the device uses the default device specified by the cd command. For file-url, you specify the path (directory) and the name of the file to be deleted.
When you attempt to delete any files, the system prompts you to confirm the deletion.
Caution
When files are deleted, their contents cannot be recovered.
This example shows how to delete the file myconfig from the default flash memory device:
Device# delete myconfig
Creating, Displaying and Extracting Files
You can create a file and write files into it, list the files in a file, and extract the files from a file as described in
the next sections.
Beginning in privileged EXEC mode, follow these steps to create a file, display the contents, and extract it:
Procedure
Command or Action
Purpose
Step 1
archive tar /createdestination-urlflash:/file-url
Example:
Device# archive tar /create
tftp:172.20.10.30/saved.
flash:/new-configs
Creates a file and adds files to it.
For destination-url, specify the destination URL alias for the local or network file system and the name of the file to create:
For flash:/file-url, specify the location on the local flash file system in which the new file is created. You can also specify an optional list
of files or directories within the source directory to add to the new file. If none are specified, all files and directories
at this level are written to the newly created file.
Step 2
archive tar /tablesource-url
Example:
Device# archive tar /table
flash: /new_configs
Displays the contents of a file.
For source-url, specify the source URL alias for the local or network file system. The -filename. is the file to display. These options are supported:
You can also limit the file displays by specifying a list of files or directories after the file. Only those files appear.
If none are specified, all files and directories appear.
Step 3
archive tar /xtractsource-url flash:/file-url [dir/file...]
Example:
Device# archive tar /xtract
tftp:/172.20.10.30/saved.
flash:/new-configs
Extracts a file into a directory on the flash file system.
For source-url, specify the source URL alias for the local file system. The -filename. is the file from which to extract files. These options are supported:
For flash:/file-url [dir/file...] , specify the location on the local flash file system from which the file is extracted. Use the dir/file... option to specify a list of files or directories within the file to be extracted. If none are specified, all files and directories
are extracted.
Step 4
more [ /ascii | /binary | /ebcdic] /file-url
Example:
Device# more
flash:/new-configs
Displays the contents of any readable file, including a file on a remote file system.
This table provides release and related information for features explained in this module.
These features are available on all releases subsequent to the one they were introduced in, unless noted otherwise.
Release
Feature
Feature Information
Cisco IOS XE Fuji 16.9.2
Flash File System
The flash file system is a single flash device on which you can store files. It also provides several commands to help you
manage software bundles and configuration files.
Use Cisco Feature Navigator to find information about platform and software image support. To access Cisco Feature Navigator,
go to http://www.cisco.com/go/cfn.