< Home

rename (SFTP client view)

Function

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

Format

rename old-name new-name

Parameters

Parameter Description Value
old-name

Specifies the name of a file or directory.

The value is a string of 1 to 64 case-insensitive characters without spaces.
new-name

Specifies the new name of the file or directory.

The value is a string of 1 to 64 case-insensitive characters without spaces.

Views

SFTP client view

Default Level

3: Management level

Usage Guidelines

You can run the rename command to rename a file or directory.

Example

# Rename the directory yourtest on the SFTP server.

<HUAWEI> system-view
[HUAWEI] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> rename test/yourtest test/test
Warning: Rename /test/yourtest to /test/test? [Y/N]:y
Info: Succeeded in renaming file.
sftp-client> cd test
Current directory is:
/test
sftp-client> dir
drwxrwxrwx   1 noone    nogroup         0 Mar 29 2012 .
drwxrwxrwx   1 noone    nogroup         0 Mar 29 2012 ..
drwxrwxrwx   1 noone    nogroup         0 Mar 24 2012 test
-rwxrwxrwx   1 noone    nogroup      5736 Mar 24 2012 backup.txt
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >