HomeFTPHow to recursively download folders via FTP-Linux command line

How to recursively download folders via FTP-Linux command line

There are times when sharing files using email as attachments are not possible, and then one of the best ways is to put those files in an FTP server. Of course, it is even better to put all of them in a zip file, but what if this is not possible?

So, if you have a full folder structure you need to download using some recursive download tool, you have some options, one of them is gftp which is a graphic ftp client, but here we will discuss how to do this using the command line of Linux.

Download full ftp folders recursively

Using ncftpget to recursively download files and folders from FTP

First install ncftp tools:

For Debian / Ubuntu

apt-get install ncftp
For Arch Linux'
pacman -Syu ncftp

or with your package manager.

Then issue this command.

ncftpget -R -v -u "username" remote-server.com /local-directory remote-directory

It will ask you for the password.

Using wget to download files, recursive mode

wget is a great tool, and it can also be used with FTP servers, and it also can download files and folders recursively.

wget -r ftp://username:password@remote-server

Or if you want to fetch the files under a particular folder:

wget -r ftp://hostname/path-to-folder/ --ftp-user=user --ftp-password=password
Scroll to Top