< Home

delete (user view)

Function

The delete command deletes a specified file in the storage device.

Format

delete [ /unreserved ] [ /quiet ] { filename | devicename } [ all ]

Parameters

Parameter

Description

Value

/unreserved

Deletes a specified file. The deleted file cannot be restored.

-
/quiet

Deletes a file directly without any confirmation.

-
filename

Specifies the name of a file to be deleted.

The value is a string of 1 to 160 case-insensitive characters without spaces in the format [ drive ] [ path ] filename. If the string is enclosed in double quotation marks (" "), the string can contain spaces. If the value is a file name, the value is a string of 1 to 64 characters.

In the preceding parameter, drive specifies the storage device name, and path specifies the directory and subdirectory.

You are advised to add : and / between the storage device name and directory. The directory name cannot contain the following characters: ~ * / \ : ' "

devicename

Deletes all the files in the storage device.

-

all

Deletes files in the specified directory in a batch from all storage devices.

NOTE:

This parameter is available only in a stack system.

-

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

The following describes the drive name.

  • drive is the storage device and is named as flash:.

  • If devices are stacked, drive can be named as:

    • flash: root directory of the flash memory of the master switch in the stack.
    • chassis ID#flash: root directory of the flash memory on a device in the stack.

    For example, slot2#flash: indicates the flash memory in slot 2.

The path can be an absolute path or relative path. A relative path can be designated relative to either the root directory or the current working directory. A relative path beginning with a slash (/) is a path relative to the root directory.
  • flash:/my/test/ is an absolute path.

  • /selftest/ is a path relative to the root directory and indicates the selftest directory in the root directory.

  • selftest/ is a path relative to the current working directory and indicates the selftest directory in the current working directory.

Like devicename, drive specifies the storage device name.

Precautions

  • The wildcard (*) character can be used in the delete command.
  • If the parameter /unreserved is not included, the file is stored in the recycle bin. To display all files including deleted files that are displayed in square brackets ([ ]), run the dir /all command. To restore these files that are displayed in square brackets ([ ]), run the undelete command. To clear these files from the recycle bin, run the reset recycle-bin command.

    If you delete a file using the /unreserved parameter, the file cannot be restored.

  • If you delete a specified storage device, all files are deleted from the root directory of the storage device.

  • If you delete two files with the same name from different directories, the last file deleted is kept in the recycle bin.

  • If you attempt to delete a protected file, such as a configuration file, or patch file, a system prompt is displayed.

  • You cannot delete a directory by running the delete command. To delete a directory, run the rmdir (user view) command.

Example

# Delete the file test.txt from the flash:/test/ directory.

<HUAWEI> delete flash:/test/test.txt
Delete flash:/test/test.txt?[Y/N]:y

# Delete the file test.txt from the current working directory flash:/selftest.

<HUAWEI> delete test.txt
Delete flash:/selftest/test.txt?[Y/N]:y
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >