< Home

rmdir (user view)

Function

The rmdir command deletes a specified directory from the storage device.

Format

rmdir directory

Parameters

Parameter Description Value
directory

Specifies a directory or directory and its path.

The value is a string of case-insensitive characters in the [ drive ] [ path ] directory format. The absolute path length ranges from 1 to 64, while the directory name length ranges from 1 to 15.

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

The directory name cannot contain the following characters: ~ * / \ : ' "

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.

Precautions

  • Before running the rmdir command to delete a directory, you must delete all files and subdirectories from the directory.

  • A deleted directory and its files cannot be restored from the recycle bin.

Example

# Delete the directory test from the current directory.

<HUAWEI> rmdir test
Remove directory flash:/test?[Y/N]:y
%Removing directory flash:/test...Done!%Removing directory flash:/test....Done! 
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >