Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to copy file on remote server using lftp?

Moving files is as easy as using mv command, but is there any command equivalent to cp?

share|improve this question
up vote 1 down vote accepted

from the man page:

Obsolete. Use one of the following instead:
    get ftp://... -o ftp://...
    get -O ftp://... file1 file2...
    put ftp://...
    mput ftp://.../*
    mget -O ftp://... ftp://.../*
or  other  combinations  to  get FXP transfer (directly between two ftp
servers).  lftp would fallback to plain copy (via client) if FXP trans-
fer cannot be initiated or ftp:use-fxp is false.

so you can copy a file, by doing:

get filename -o ftp://user@ftpsite/directory/copyoffile

perhaps that will work better than a put/get if only because you'll be doing something like FXP, and the server will be using its own local bandwidth

share|improve this answer

from automated bash script:

lftp -u login,password -e "put file ; exit "

and from lftp's interactive shell:

put localFileToBeSent
share|improve this answer
Thanks for the answer, but I was asking asking how to copy file on remote server, not to the remote server. The file is already on remote server and I want to have a copy of it with diffrent name and directory. Do I have to use local server, get and put commands for this? – takeshin May 15 '10 at 15:43
it looks that way, just looking at the help output in lftp, there's nothing that even hints at a copy command. get/put looks like how you'll have to do it. – cpbills May 15 '10 at 17:32
@cpbills afaik it's not a standard command so your will need some luck and support for whateever it is on the other end of your connection. – pQd May 15 '10 at 17:40
how do you mean? get and put are fairly common commands. did you mean to put the comment on my answer? and yeah, a server needs to support fxp in some capacity, but it's an actual solution. – cpbills May 15 '10 at 19:34

Check the mirror builtin to transfer one or several files :

lftp builtin mirror can download or update a whole directory tree. There is also reverse mirror (mirror -R) which uploads or updates a directory tree on server. Mirror can also synchronize directories between two remote servers, using FXP if available.


  • lftp> mirror -R -i file1 ftp ://
  • lftp> mirror -R
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.