-->
Previous | Table of Contents | Next |
Once you are on the remote system, you can use Linux (UNIX) commands to display file contents and move around directories. To display the contents of a directory, use the command ls or the DOS equivalent dir. To change to a subdirectory, use the cd <dir> command. To return to the parent directory (the one above the current directory), use the command cd Unlike Linux, there are no keyboard shortcuts available with FTP so you have to type in the names of files or directories in their entirety (and correctly).
As you move through the directories and find a file you want to move to your system, use the FTP get command, as in:
get file1.txt
The commands get (download) and put (upload) are relative to your home machine, not to the remote. When you issue a get command, you are telling your systems FTP software to get a file from the remote machine. A put commands tells FTP to put a file from your local machine onto the remote machine. It is important to remember which command moves in which direction or you could accidentally overwrite files.
The quotation marks around filenames are optional for most versions of FTP, but they do provide specific characters to the remote version (preventing shell expansion). This can prevent error messages from FTP or accidental transfers of many files instead of just one, so quotation marks are a useful practice to employ.
When you issue a get command, the remote system transfers data to your local machine and displays a status message when it is completed. There is no indication of progress during transmission of a large file, so be patient. This is a sample transcript of a get command:
FTP> get file1.txt 200 PORT command successful. 150 BINARY data connection for FILE1.TXT (27534 bytes) 226 BINARY Transfer complete. 27534 bytes received in 2.35 seconds (12 Kbytes/s).
FTP provides two modes of file transfer: ASCII (7 bit characters) and Binary (8 bit characters). Some systems automatically switch between the two, although it is a good idea to manually set the mode to ensure you dont waste time. You must download all Linux distribution files in Binary mode. To set FTP in binary transfer mode (for any executable file), type the command
binary
You can toggle back to ASCII mode with the command ASCII. If you transfer a binary file in ASCII mode, it will not be executable. Transferring an ASCII file in Binary mode does not affect the contents of the file, so Binary is a good default transfer mode.
Tip:
If there are many files you want to transfer all at once and dont want to bother typing each files name, use the mget command. Simply type mget and a wildcard, and an FTP prompt appears asking if it should transfer each file matching that name. For example, lets say mget * matches all the files in the directory; youll be asked whether you want to get each one. To suppress the questions and force a transfer of each file that matches your wildcard, do so by entering the command prompt. This turns off the prompts and transfers all the matching files one after another.
To quit FTP, type the command quit or exit. Both commands close your session on the remote machine, then terminate FTP on your local machine.
Keep in mind that the Linux archives are quite sizable, and transferring even a small distribution can take a while with asynchronous modems. If you use a slow modem (9,600 baud or less), you may want to consider an alternative method since your connection will have to remain in place for many hours. Some remote sites limit the amount of time you can stay connected.
Linux FTP Archive Sites
The list of Linux FTP archive sites changes slowly, but the sites listed below were all valid and accessible as this book went to press. Many of these sites are mirror sites, providing exactly the same content as the primary sites. The primary sites (also called home sites) for the Linux FTP archives are tsx-11.mit.edu, sunsite.unc.edu, and nic.funet.fi. Home sites are where most of the new software loads begin. The majority of sites on the previous list mirrors one of these three sites.
The site nearest you can be found by using the country identifier at the end of the site name (uk=United Kingdom, fr=France, and so on). Most versions of FTP allow either the machine name or the IP address to be used, although if the name cannot be interpreted by the local Internet gateway, the IP address is the best addressing method. Make sure you enter the four components of the IP address correctly. Table 2.1 shows the sites that were good sources of Linux material as this book went to press.
Site name | IP address | Directory |
---|---|---|
tsx-11.mit.edu | 18.172.1.2 | /pub/linux |
sunsite.unc.edu | 152.2.22.81 | /pub/Linux |
nic.funet.fi | 128.214.6.100 | /pub/OS/Linux |
ftp.mcc.ac.uk | 130.88.200.7 | /pub/linux |
fgbl.fgb.mw.tu-muenchen.de | 129.187.200.1 | /pub/linux |
ftp.infdrrnatik.twmuenchen.de | 131.159.0.110 | /pub/Linux |
ftp.dfv.rwth-aachen.de | 137.226.4.105 | /pub/linux |
ftp.informatik.rwth-aachen.de | 137.226.112.172 | /pub/Linux |
ftp.ibp.fr | 132.227.60.2 | /pub/linux |
kirk.bu.oz.au | 131.244.1.1 | /pub/OS/Linux |
ftp.uu.net | 137.39.1.9 | /systems/unix/ linux |
wuarchive.wustl.edu | 128.252.135.4 | /systems/linux |
ftp.win.tue.nl | 131.155.70.100 | /pub/linux |
ftp.stack.urc.tue.nl | 131.155.2.71 | /pub/linux |
ftp.ibr.cs.tu-bs.de | 134.169.34.15 | /pub/os/linux |
ftp.denet.dk | 129.142.6.74 | /pub/OS/linux |
If you encounter difficulties connecting to one site, try another. If difficulties persist, there may be a problem with your access to the Internet.
Previous | Table of Contents | Next |