delete

Deletes a file from the flash device.

Syntax

delete flash:///flash-type /filename

Parameters

flash-type { config-file | coredumps | pcap-file | ms_images | chassis-ms | ifmgr-ms | lacp-ms | lldp-ms | mgmt-cli | mgmtsvc-apigw | mgmt-snmp-agent }
Specifies the file type.
filename
Specifies the name of the file to be deleted from the flash device.

Modes

Exec mode

Usage Guidelines

This command is available only to users with admin role.

The active PCAP file cannot be deleted.

Table 1. Error messages
Message Reason
Error: File flash://mgmt-cli/filename not found Specified file does not exist. Example: delete flash://mgmt-cli test123
% Unknown command. Poorly formed command. Example: delete flash://mgmt-cli123 test123
% Command incomplete. Example: delete flash://mgmt-cli
% Unknown command. Insufficient privileges, even though command is formed correctly. Example: delete flash://mgmt-cli test

Examples

The following example deletes a configuration file.

device# delete flash://config-file test.txt 

Warning: File flash://config-file/test.txt will be deleted (from flash). 

Do you want to continue? [y/n]:

The following example deletes a PCAP file.

device# delete flash://pcap-file/test.pcap
The following example attempt to delete a system-created file
device# delete flash://config-file ../config_file
Warning: File flash://config-file/../config_file will be deleted (from flash).
Do you want to continue? [y/n]: y
Error : while removing the file flash://config-file/../config_file