Recursive FTP from the Command Line

The default command line ftp client in most UNIX distributions do not support recursive downloads, even though recursive downloads is a basic feature in most GUI based ftp clients. But if you do not have access to the X-Windows or GUI, there are alternative ways to achieve the same result from the command line.

Recursive FTP Download

One alternative method is to use the wget command.

If your wget client does not support the ‘–user’ and ‘–password’ arguments, you must modify the FTP URL to include the login details.

Another alternative method is to use the lftp command for the recursive FTP download. Login to the FTP site, change to the required remote directory and use the mirror option to start the recursive download.

Recursive FTP Upload

To perform a recursive FTP upload, lftp is the only option for now as wget does not allow FTP uploads.

The mirror -R option in lftp can be used for the upload.

Recursive FTP in Windows

Both wget and lftp are available in Windows as part of the Cygwin environment.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }