< Home

rename (user view)

Function

The rename command renames a file or a directory.

Format

rename source-filename destination-filename

Parameters

Parameter Description Value
source-filename Specifies the name of a source file or a directory. The name is a string of 1 to 160 characters.
destination-filename Specifies the name of a source file or a directory. The name is a string of 1 to 160 characters.

Views

User view

Default Level

3: Management level

Usage Guidelines

If the name of the destination file is the same as that of an existing directory or an existing file, the system prompts an error message.

The rename command cannot be used to rename a file in other directories.

Example

# Rename the file sample.txt as sample.bak.

<sysname> rename sample.txt sample.bak
Rename hda1:/sample.txt to hda1:/sample.bak ?[Y/N]: y
Info:Rename file hda1:/sample.txt to hda1:/sample.bak ......Done.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >