LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Downloading directories with FTP (https://www.linuxquestions.org/questions/linux-newbie-8/downloading-directories-with-ftp-418145/)

mijohnst 02-21-2006 05:26 PM

Downloading directories with FTP
 
I don't use FTP at all but I recently bought one of those crappy Buffalo TeraStations and the freaking thing doesn't support NFS. Therefor I'm forced to use SMB or FTP. Is there a command to download everything in a directory including directories? I know there are many GUI tools that allow you to drag folders into an FTP window so I'm figuring there must be a command behind it. Thanks!

Emerson 02-21-2006 05:53 PM

Try wget. It can log in using username and password and also reads your .netrc file.

mbreith 02-21-2006 05:58 PM

Hmm... Reading the manual 'man ftp' it looks like mget would do the job, but not very well. I don't know if it would behave very well for subdirectories. It suggests tar'ing the files and directories first and transferring them in binary mode.

t4tajinder 03-04-2006 05:25 AM

Right , there is no way we can downnload the directories using the FTP at command line . I have tried it many times , it doesnt work . Remember if you are using FTP in GUI , you can always drag and drop whatever you like But in CLI , the best option that we can do is to use mget or mput as required .If you have loads of files to be put onto the FTP server .CD into the required directory and run ftp .Use ftp -i <ftpserver-name> and then enter .Enter your username and pwd.Change binary mode by typing 'bin' and then to see the data being transferred , type the 'hash' option .Finally to transfer the files , use 'mput *'.It will start the uploading process , Note that we used '-i' option while loggin onto the FTP, that is to turn off interactivity , now that ftp wont prompt you for the y/n while transferring multiple files ...

Another cool option is to zip and tar the files and directories using tar and gzip and then transfer over the single tarred and zipped file ...

Thanks
Tajinder.singh


All times are GMT -5. The time now is 04:05 PM.