< Home

rename (SFTP client view)

Function

The rename command renames a file or directory on the SFTP server.

Format

rename old-name new-name

Parameters

Parameter Description Value

old-name

Specifies the original name of the source file or directory on the SFTP server.

The name is a string. The absolute path of the file or directory ranges from 1 to 64 characters without spaces.

new-name

Specifies the new file or directory name.

The name is a string. The absolute path of the file or directory ranges from 1 to 64 characters without spaces.

Views

SFTP client view

Default Level

2: Configuration level

Usage Guidelines

You can run the rename command to rename any file or folder in the current directory.

After being renamed, the original file or directory name automatically becomes invalid. Files in the renamed folder, however, are unaffected.

Example

# Rename the file in the authorized directory on the SSH server.

<sysname> system-view
[sysname] sftp 10.1.1.1 
Please input the username:client001
Trying 10.1.1.1 ...
Press CTRL+K to abort
Enter password:   
sftp-client> rename 222 111
Warning: Rename /222 to /111? [Y/N]: y
Info: Succeeded in renaming file.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >