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.
ibrahim@anfield:~$ mkdir dnld ; cd dnld ibrahim@anfield:~/dnld$ wget --user=username --password=password ftp://ftpsite.com/directory/to/download/
If your wget client does not support the ‘–user’ and ‘–password’ arguments, you must modify the FTP URL to include the login details.
ibrahim@anfield:~$ mkdir dnld ; cd dnld ibrahim@anfield:~/dnld$ wget ftp://username:firstname.lastname@example.org/directory/to/download/
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.
ibrahim@anfield:~$ mkdir dnld ; cd dnld ibrahim@anfield:~/dnld$ lftp ftp://ftpsite.com/ lftp ftpsite.com:~> user username Password: lftp ftpsite.com:~> cd /directory/to/download/ lftp ftpsite.com:~/directory/to/download/> mirror .
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.
ibrahim@anfield:~$ cd upld ibrahim@anfield:~/upld$ lftp ftp://ftpsite.com/ lftp ftpsite.com:~> user username Password: lftp ftpsite.com:~> cd /directory/to/upload/ lftp ftpsite.com:~/directory/to/upload/> mirror -R .
Recursive FTP in Windows
Both wget and lftp are available in Windows as part of the Cygwin environment.
Latest posts by Mohamed Ibrahim (see all)
- How to View Facebook Private Album Photos - March 2, 2014
- Keeping Warranty Intact for Sony Xperia Unlocked Phones - February 23, 2014
- How to Decrypt WhatsApp Database Messages - February 16, 2014
- Android MMC mmcblk Partition Layout - February 9, 2014
- How to Read The Straits Times Print Edition in Android Tablet for Free - February 2, 2014