Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Using Your HP Workstation > Chapter 11 Communicating over a Network

Transferring Files Remotely with ftp

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The ftp (File Transfer Protocol) program allows you to do the following tasks:

  • Copy files over a network connection between your local system and remote systems.

  • Manage files on remote systems for which you have a valid login account.

ftp is a command line program that can run in an HP VUE terminal window.

Some systems are set up to allow anonymous access to "public" files. This capability is referred to as anonymous ftp.

NOTE: The ftp server on a 10.0 host may deny access to a user if the server's /etc/passwd file is from a 9.X or earlier system. You may need to update /etc/passwd to reflect the new paths in the V.4 File System. For example, bin/sh should be updated to /usr/bin/sh.

Preparing to Use ftp

  • If your system has an /etc/hosts file, the system administrator should ensure that it contains entries for each remote systems with which you will communicate. Each entry contains the following information:

       internet_address   official_name   alias
    

    For example:

       15.15.232.18    hpabc.fc.hp.com  hpabc
    
  • Have the system administrator for the remote systems arrange to give you a password and an account, or a login to someone else's account, so that you can log in on the remote systems. (If the remote system allows anonymous ftp, you do not need an account on that system.)

Starting ftp

  1. To invoke ftp and connect to a remote system in one step, type the following in a terminal window:

       ftp remote_hostname Enter
    

  2. ftp confirms the connection with the remote system and prompts you for a remote login name:

       Name (remote_hostname):
    

  3. To log in with the same remote login name as your local login name, just press Enter.

    Otherwise, type your login name for that system and press Enter.

    To access an anonymous ftp account, use the login name "anonymous" or "ftp".

  4. ftp prompts you for a password:

       Password (remote_hostname):
    

    Type the password associated with your remote login name and press Enter. For security reasons, the password will not appear on the screen.

    To access an anonymous ftp account, use any non-null password (by convention, the password should be the host name of your own workstation).

  5. ftp confirms this action with a message:

       Password required for remote_login_name
    
       User remote_login_name logged in.
    

  6. To see a list of available commands, press ? at the ftp> prompt.

    To get help on a particular command, press ? and type the command name.

Listing and Creating Directories

While connected to a remote computer with ftp, you can view the contents of directories and move between directories.

If the remote computer has been configured correctly, you can also create and remove directories.

To do this ... Type ...
Display the name of the current remote working directory pwd
Display the name of the current local working directory !pwd
Change the working directory on the remote system to remote_directorycd remote_directory
Change the working directory on the local system to local_directorylcd local_directory
List the contents of the current remote directory ls
Create a remote directory mkdir remote_directory
Delete an empty remote directory rmdir remote_directory
Delete a remote file delete remote_file

Transferring Files from a Remote System

Use get to transfer files from a remote system to your local directory.

  1. If you are going to transfer binary files, such as graphics or executable programs, type bin at the ftp> prompt.

  2. At the ftp> prompt, type:

       ftp> get remote_file local_file Enter
    

    The remote_file can be the name of a file in the remote working directory, or a relative or absolute> path from that directory.

    If you do not specify local_file, the local destination file name will be the same as the remote source file name.

    1. ftp copies the remote file to the local file name.

    2. If the remote file is not in the current working directory on the remote system, remote_file is the absolute path name or relative path name for that file. In that case, ftp copies the file to a file name with the same path on your local system.

    3. If there is no matching path, ftp gives you a message, "No such file or directory".

    4. If the destination file already exists, ftp overwrites its contents with the contents of the remote file.

  3. During a successful copy, ftp displays messages confirming the copy and the length of time required.

Example. This example shows user leslie getting the remote file special from the remote directory /home/ftp/pub and placing it on the local system as new_info.

Figure 11-3  Use ftp to get files from remote systems.

Use ftp to get files from remote systems.

Transferring Files to a Remote System

Use put to transfer files from your local system to a remote system.

  1. If you are going to transfer binary files, such as graphics or executable programs, type bin at the ftp> prompt.

  2. At the ftp> prompt, type:

       ftp> put local_file remote_file Enter
    

    The local_file can be the name of a file in the local working directory, or a relative or absolute path from that directory.

    If you do not specify remote_file, the remote destination file name will be the same as the local source file name.

    • ftp copies the local file to the remote file name.

    • If the remote file is not in the current working directory on the remote system, remote_file is the absolute path name or relative path name for that file.

    • If the destination file already exists, ftp overwrites its contents with the contents of the local file.

  3. During a successful copy, ftp displays messages confirming the copy and the length of time required.

Example. This example shows user leslie putting the local file new_info onto the remote system as the file special in the remote directory /home/ftp/pub.

Figure 11-4  Use ftp to put files on remote systems.

Use ftp to put files on remote systems.

Exiting ftp

To close the connection with the remote system and exit ftp, type:

   ftp> bye Enter
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© © 1983-1995 Hewlett-Packard Development Company, L.P.