How to use ncftpget to copy directories from FTP server.

The old ftp command is not convenient for recursively copying directories from the command line. An alternative to the ftp command is the ncftpget.

1. Download ncftpget

a. RHEL/Fedora/CentOS


yum install ncftpget

b.Debian/Ubuntu


apt-get install ncftpget

2. Make sure you have the hostname, username and password of the ftp server, from which you want to download a bunch of directories. Let us say you want to copy /var/www/html in the ftp server to a local directory /home/user1/Desktop


ncftpget –u ftpusername -R -v ftp.example.com /home/user1/Desktop /var/www/html

You will be prompted for a password, once you entered the correct password, it will recursively(-R) download the files under /var/www/html to /home/user1/Desktop in a verbose(-v) mode – that is you will see the file transfer on your screen for each file.

The format is


ncftpget -u username -R -c hostname-of-ftp-server local-directory remote-directory

Of course it is recommended to use ftp as a last resort, otherwise you should use secure tools or protocols for security reasons. Recommended ones are sftp and scp.

Be Sociable, Share!

5 Thoughts on “Copy whole directory from command line

  1. Pingback: Konto ohne Schufa

  2. Pingback: Outdoor projects

  3. Great article, thanx for sharing!

  4. Pingback: Subliminal Advertising

  5. Pingback: The Best free classifieds Site

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Post Navigation