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

I have a folder that contains multiple subdirectories. I would like to copy the contents of the folder over ftp (using lftp preferably) instead of the entire folder.

When I use the mirror command, it seems to copy the folder over, which means that my files are one level higher than expected.

share|improve this question
Can you show an example of the directory structures on both sides (local and remote)? – slm Feb 10 '13 at 5:49
No problem. Local side: public, which contains folder1, folder2, folder3, multiple files Server side: I have a folder www. My goal is to copy folder1, folder2, folder3 and the multiple files inside public directly to www. – Astephen2 Feb 10 '13 at 20:00
up vote 3 down vote accepted

I usually use this form of the command to download:

% lftp -e 'mirror <remote download dir> <local download dir>' -u <username>,<pass> -p <port> <hostname>

If you want the contents of the folder just add the trailing slash like so:

% lftp -e 'mirror /some/remote/directories/contents/ /my/home/downloads/somedir/.' -u joeuser
share|improve this answer
That worked perfectly. Thank you very much. – Astephen2 Feb 10 '13 at 20:02

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.