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.
•Information About the Flash File System
•Displaying Available File Systems
•Setting the Default File System
•Displaying Information About Files on a File System
•Changing Directories and Displaying the Working Directory
•Creating and Removing Directories
•Creating, Displaying, and Extracting Files
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 switch is named flash:.
As viewed from the stack master, or any stack member, flash: refers to the local flash device, which is the device attached to the same switch on which the file system is being viewed. In a switch stack, each of the flash devices from the various stack members can be viewed from the stack master. The names of these flash file systems include the corresponding switch member numbers. For example, flash-3:, as viewed from the stack master, 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 switch stack.
Only one user at a time can manage the software bundles and configuration files for a switch stack.
To display the available file systems on your switch, use the show file systems privileged EXEC command as shown in this example for a standalone switch:
Switch# show file systems
File Systems:
Size(b) Free(b) Type Flags Prefixes
* 15998976 5135872 flash rw flash:
- - opaque rw bs:
- - opaque rw vb:
524288 520138 nvram rw nvram:
- - network rw tftp:
- - opaque rw null:
- - opaque rw system:
- - opaque ro xmodem:
- - opaque ro ymodem:
This example shows a switch stack. In this example, the stack master is stack member 1; the file system on stack member 2 is displayed as flash-2, the file system on stack member 3 is displayed as flash-3 and so on. The example also shows the crashinfo directories and a USB flash drive plugged into the stack master.
Switch# show file systems
File Systems:
Size(b) Free(b) Type Flags Prefixes
145898496 68792320 disk rw crashinfo:
146014208 99090432 disk rw crashinfo-2:
248512512 87031808 disk rw crashinfo-3:
146276352 108003328 disk rw crashinfo-4:
* 1749458944 1258868736 disk rw flash:
729546752 282853376 disk rw flash-2:
1622147072 1173880832 disk rw flash-3:
1749549056 1301282816 disk rw flash-4:
0 0 disk rw unix:
- - disk rw usbflash0:
1027342336 64749568 disk rw usbflash0-2:
- - disk rw usbflash0-3:
- - disk rw usbflash0-4:
- - opaque rw system:
- - opaque rw tmpsys:
- - nvram rw stby-nvram:
- - nvram rw stby-rcsf:
- - opaque rw null:
- - opaque ro tar:
- - network rw tftp:
2097152 2071500 nvram rw nvram:
- - opaque wo syslog:
- - network rw rcp:
- - network rw http:
- - network rw ftp:
- - network rw scp:
- - network rw https:
- - opaque ro cns:
You can specify the file system or directory that the system uses as the default file system by using the cd filesystem: 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.
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 Table 1-2.
To display information about the driver text object in the CISCO-MEMORY-POOL-MIB, use the show memory privileged EXEC command:
Switch# show memory
System memory : 1939252K total, 1317664K used, 621588K free, 118580K kernel reserved
Lowest(b) : 54189544
Total(K) Used(K) Free(K)
Process 1939252 1317664 621588
Config 0 0 0
Beginning in privileged EXEC mode, follow these steps to change directories and to display the working directory:
Beginning in privileged EXEC mode, follow these steps to create a directory:
To remove a directory with all its files and subdirectories, use the delete /force /recursive filesystem:/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 the files in the directory and the directory are removed.
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.
Network file system URLs include ftp:, rcp:, and tftp: and have these syntaxes:
•FTP—ftp:[[//username [:password]@location]/directory]/filename
•RCP—rcp:[[//username@location]/directory]/filename
•TFTP—tftp:[[//location]/directory]/filename
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
•From a device to the same device (for example, the copy flash: flash: command is invalid)
For specific examples of using the copy command with configuration files, see the Chapter 2 "Working with the Configuration Files."
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 switch 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.
This example shows how to delete the file myconfig from the default flash memory device:
Switch# delete myconfig
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:
This example shows how to create a file. This command writes the contents of the new-configs directory on the local flash device to a file named saved. on the TFTP server at 172.20.10.30:
Switch# archive tar /create tftp:172.20.10.30/saved. flash:/new-configs
This example shows how to extract the contents of a file located on the TFTP server at 172.20.10.30:
Switch# archive tar /xtract tftp:/172.20.10.30/saved. flash:/new-configs