13

I am using ftp in the command line (terminal) to transfer multiple data files from a remote server to my local computer. There are multiple files (~40) in the directory and I would like to transfer them all without having to answer yes in the prompt for each file. I tried mget * but this only transferred the first file and then a prompt popped up for the second file.

3 Answers 3

16

Issue a prompt command first to turn interactive prompting off.

Alternatively, if you have control over the way the ftp command is called, use the command line option, as suggested by @reg-edit:

ftp [-i | --no-prompt] [OPTIONS] [HOST [PORT]]

6

As an alternative to issuing a prompt command ahead of your other commands, you may invoke ftp with the -i switch.

4

When you already started ftp you can issue the prompt command to toggle between getting prompted and not getting prompted. So this should do the trick:

> ftp <some server>
ftp> prompt
Interactive mode OFF .
ftp> mget *

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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