How to move files using FTP commands

158,764

Solution 1

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

Solution 2

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.

Share:
158,764
Kermia
Author by

Kermia

Near ... Far .. Wherever you are !

Updated on July 05, 2022

Comments

  • Kermia
    Kermia almost 2 years

    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?

  • user2545330
    user2545330 about 10 years
    @Johan can I use one command line like: RNFR /public_html/upload/64/SomeMusic.mp3 RNTO /public_html/archive/2011/05/64/SomeMusic.mp3?
  • Martin Prikryl
    Martin Prikryl over 7 years
    @user2545330 No, those are two separate FTP commands. Though in most (command-line) FTP clients, you cannot use those commands directly anyway (you can use quote RNFR /public_html/upload/64/SomeMusic.mp3 and quote RNTO /public_html/archive/2011/05/64/SomeMusic.mp3). Why would you, if you can use the rename /public_html/upload/64/SomeMusic.mp3 /public_html/archive/2011/05/64/SomeMusic.mp3?
  • Martin Prikryl
    Martin Prikryl almost 3 years
    Do you really have an ftp client that does not support rename command? See my comment to the @Johan's answer.