Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move files using FTP commands

Path of source file is : /public_html/upload/64/SomeMusic.mp3

And I want to move it to this path : /public_html/archive/2011/05/64/SomeMusic.mp3

How can i do this using FTP commands?

like image 232
Kermia Avatar asked Feb 27 '12 08:02

Kermia


People also ask

Does FTP have a move command?

The FTP command to move files is "rename," in effect renaming the file path. Automate uses this same command to move a file into its new location.

Does FTP copy or move files?

All about File Transfer Protocol and FTP clients File Transfer Protocol (FTP) is a network protocol for transferring copies of files from one computer to another. An FTP client is a program that allows you to move files between computers.


2 Answers

In FTP client:

rename /public_html/upload/64/SomeMusic.mp3 /public_html/archive/2011/05/64/SomeMusic.mp3 

With FTP commands:

RNFR /public_html/upload/64/SomeMusic.mp3 RNTO /public_html/archive/2011/05/64/SomeMusic.mp3 

source: http://www.nsftools.com/tips/RawFTP.htm

like image 147
Johan Avatar answered Sep 21 '22 20:09

Johan


Just in case someone else will search for a solution to move files by ftp and will not find a solution: As I encountered the same problem and even the RNFR and RNTO will not work like in my case: I solved this by doing the following workaround:

mget files*.ext cd /path/to/desired/folder/ mput files*.ext 

This is twice the traffic (get and put) but for smaller files it is at least a solution.

like image 27
Stephan Avatar answered Sep 25 '22 20:09

Stephan