Home > Unix > UNIX – Lesson 021 – ftp command

UNIX – Lesson 021 – ftp command


ftp
The “ftp” (file transfer protocol) command is used to copy file from one computer to another.

Syntax :
ftp [-i] hostname

Key arguments:
-i Turns off interactive prompting during multiple file transfers

Example :
$ ftp –i itctnss0123
Connected to itctnss0123.
220 itctnss0123FTP server (SunOS 5.8) ready.
Name (itctnss0123:xarabas):
331 Password required for xarabas.
Password:
230 User xarabas logged in.
ftp>

=================================================================================
“ftp“ commands
Where command is one of:

  • ? Lists all ftp command
  • get get a file from remote computer
  • put send a local file to the remote computer
  • ls lists files on the remote computer
  • ![command] Runs command as a shell command on the local machine
  • bell Sounds a bell after each file transfer command is completed
  • binary Sets the “representation type” to “image”.
  • hash Print hash-sign (#) for each data block transferred. The size of a data block is 8192 bytes.
  • cd Changes the working directory on the remote machine
  • lcd Changes the working directory on the local machine
  • mget like get, but allows use of wildcards (* ?)
  • mput like put, but allows use of wildcards (* ?)
  • prompt By default, prompting is turned on. If prompting is turned off, any “mget” or “mput” will transfer all files
  • pwd Prints the name of the current working directory on the remote machine
  • status Show the current status of ftp
  • bye leaves ftp

Example :

$ ftp itctnss0100
Connected to  itctnss0100.
220  itctnss0100FTP server (UNIX(r) System V Release 4.0) ready.
Name ( itctnss0100:root):
331 Password required for root.
Password:
230 User root logged in.
ftp> bin
200 Type set to I.
ftp> hash
Hash mark printing on (8192 bytes/hash mark).
ftp> get group
200 PORT command successful.
150 Binary data connection for group (164.130.x.x,34460) (291 bytes).
###
226 Binary Transfer complete.
local: group remote: group
291 bytes received in 0.00079 seconds (357.91 Kbytes/s)
ftp> bye
$

Advertisements
Categories: Unix
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: