Tags:
create new tag
, view all tags
See UsingLinuxCommands and AboutThesePages for the intent of this series of pages.

See UsingFtpReminder for a short version of this page.

Contents:

Intent

This page describes how to use ncftp to download a file from a remote computer.

Note: Use ncftp in preference to ftp -- it has a few more features than ftp including the ability to resume an incomplete transfer.

Sample Task

Download:

  • file: Mandrake72-inst.iso
    • from directory: /pub/linux/distributions/mandrake/iso
    • to directory: /mnt/DOS_hda8
      • on: <my computer>

Other Preconditions

  • I logged in as root because root privileges are required to write to /mnt/DOS_hda8, otherwise I could have done this under my own userid. If I did need to be root, I could have logged in under my regular username and then su'd to root before starting (nc)ftp. See UsingSuBeginner or UsingSuReminder. At the time I wrote this, I did not know how to change permissions on /mnt/DOS_hda8 because it is a fat32 (vfat) partition. I now know how to do this -- should revise this or reference another page.

Sample Session

  • Before starting ncftp: switch to the (local) directory where you want to save the file. Otherwise, use lpwd and lcd from within ncftp to switch to the desired local directory after you've started ncftp.

  • Make sure you have permission to store a file in the desired directory. Otherwise su or change permissions as appropriate.

  • Make sure you have sufficient space in the desired directory -- it seems ncftp (and maybe all ftp clients) will simply delete a partially donwloaded file if they run out of space.

  • Start ncftp by typing:
ncftp

  • You will get a prompt like:
ncftp>

  • Open a connection to the ftp site, using:
ncftp> open ftp://carroll.cac.psu.edu

If you are not doing an anonymous ftp (i.e., you need to enter your userid and password) you can use the open command like this (substitute your information for the stuff in angle brackets, and delete the angle brackets):

ncftp> open -u <userid> -p <password>  ftp://<ftp-site>

For example:

ncftp> open -u rhkramer -p not_telling  ftp://carroll.cac.psu.edu

  • Move to the directory on the ftp site containing the file you want to get, using cd:
ncftp> cd /pub/linux/distributions/mandrake/iso/

  • Set a bookmark so that, if any problem occurs, you can get back to this location at this site with the minimum effort:
ncftp> bookmark carroll

 
Later, if you need to, after starting ncftp you can say "open carroll" and ncftp will open the ftp site and move to the correct directory.

  • Confirm that you are in the proper local directory using:
ncftp> lpwd

  • If necessary, move to the correct directory using:
ncftp> lcd /mnt/DOS_hda8

  • Start the transfer using:
ncftp> get Mandrake72-inst.iso

Note: If you are restarting a failed transfer, you will be given a list of options, like: "[O]verwrite [R]esume [A]ppend to [S]kip [N]ew Name". Enter "R" to Resume the transfer (not "A" to Append).

  • When the file transfer is done, close ncftp:
ncftp> quit

  • Run md5sum and check the result against the md5 file signature to confirm that the file transfer is complete and correct:
md5sum Mandrake72-inst.iso

  • If the md5 sum is incorrect, consider using rsync to fix it without redownloading the entire file. See RsyncingALargeFile.

ToDos

  • Test these instructions, or better yet, have somebody else test them and confirm they work. (I have tested them, but without following line by line. It wasn't until today that I just happened to notice that I was still referring to the md5.exe program (one that works for Dos/Windows) rather than the md5sum program for Linux.)

-- RandyKramer - 08 Jun 2001
(transferred from swiki, originally from CLUG wiki)

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2003-03-15 - RandyKramer
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look