Charles Ma Charles Ma - 6 months ago 28
Linux Question

How to recursively download a folder via FTP on Linux

I'm trying to ftp a folder using the command line ftp client, but so far I've only been able to use 'get' to get individual files.


You could rely on wget which usually handles ftp get properly (at least in my own experience). For example:

wget -r

You can also use -m which is suitable for mirroring. It is currently equivalent to -r -N -l inf.

If you've some special characters in the credential details, you can specify the --user and --password arguments to get it to work. Example with custom login with specific characters:

wget -r --user="user@login" --password="Pa$$wo|^D"