logo Rename rename a file or folder on the host computer

Return to Introduction     

rename {filename1} {filename2}

 

Where:

 

filename1is the name of an existing file or folder on the remote host computer.
filename2is the name to which the file or folder will be renamed.

 

It either filename1 or filename2 contains a space it must be enclosed in double quotes. For example:

 

rename "file 1.txt" "file 2.txt"

 

Examples:

 

rename file1.txt file2.txt

rename newfile.new newfile.old

rename "file 1.txt" "file 2.txt"

 

Return Codes:

 

550This return code can be caused by any of the following:
filename1 not found in the current directory on the remote host computer.
filename2 already exists in the current folder on the remote host computer.

 

Sample Script:

 

* Sample script using the "rename" command

* Upload test.txt

put test.txt

* rename test.txt

rename test.txt test2.txt