Sharing files on the Internet with ftp

Sharing files on the Internet with ftp is similar to getting files; instead of retrieving files, however, you give files to other people (Code Listing 12.2).

Code Listing 12.2. Using put, you can share your files with other people on the Internet.
[ejr@hobbes ejr]$ ftp ftp.raycomm.com
Connected to www.raycomm.com.
220 ftp.raycomm.com FTP server (NcFTPd 2.1.2,
   registered copy) ready.
Name (ftp.raycomm.com:ejr): ejray
331 User ejray okay, need password.
Password:
230-You are user #8 of 100 simultaneous users
  allowed.
230-
230 Logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd incoming
250 "/home/ftp/pub/users/e/ejray/incoming" is
   new cwd.
ftp> binary
200 Type okay.
ftp> put myjokes.gz
local: myjokes.gz remote: myjokes.gz
200 PORT command successful.
150 Opening BINARY mode data connection.
226 Transfer completed.
128889 bytes sent in 15.5 secs (8.1
   Kbytes/sec)
ftp> quit
221 C-ya!
[ejr@hobbes ejr]$

To share files on the Internet with ftp:

1.
ftp ftp.raycomm.com

Open the ftp connection as shown in the previous section.

2.
youruserid

Log in with your userid.

3.
password

Enter your password.

4.
cd incoming

Use standard UNIX directory commands (ls, cd, and so on) to move into the directory you want to put the files into (Code Listing 12.2). incoming is often the right directory name to use, particularly on public ftp servers.

5.
binary

Set the file type. You'll want to use the binary file type for any files other than text or HTML files; use ascii for text or HTML.

6.
put myjokes.gz

Type put, followed by the name of the file you're making available.

7.
quit

Type quit when you're done.

Tip

On public ftp servers that accept incoming files, you might not be able to list the files in the incoming directory or see anything in there. In this case, you essentially just cast your file into a big open room and close the door. This allows ftp administrators to screen the incoming files before making them available for downloading.


Tip

You can use the mput command to make multiple files available.


Tip

If you're transferring a lot of files at once—say, for example, you're moving all of your files from your old ISP to your new one—consider using tar and gz to collect and zip up all of your files, then transferring just a single file. See Chapter 13 for more information about these commands.


Tip

Navigate in your local system (for example, to change to a directory containing files to put) with regular UNIX commands like ls, pwd, and cd, prefaced with an l. For example, pwd would display the path and name of the current directory on the other system, and lpwd would display the path and name of the current directory on the local system.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.150.89