[Ilugc] FTP on the COMMANDLINE

  • From: vishnukraj007@xxxxxxxxx (Vishnu Raj)
  • Date: Wed Jan 13 16:35:04 2010

The basics of FTP on the command line are simple, you type the
address, login, cd to the directory where the file is you want, and
you type "get <file_name>" and when the file is downloaded you type
"bye" to close the connection.
To show you that the FTP program is running your prompt will change to
a special FTP prompt:

ftp>

Okay, let me show in an example how to download the D Small Linux ISO:
"dsl-1.3.1.iso" using the commandline:

[bruno:~]$ ftp -v ftp.nluug.nl
Connected to ftp.nluug.nl.
220-There are currently 183 users logged in (max 850).
220-There are 50 extra sessions available for IPv6 clients
220-This is an IPv4 session
220-
220-Welcome to the FTP archive of SURFnet BV and
220-The Netherlands Unix Users Group (NLUUG).
220-
220-This server is located in The Netherlands, Europe.
220-If you are abroad, please find an ftp site near you.
220-Most information on this site is mirrored.
220-
220-Information about your login and any transfers you do are logged.
220-If you don't like this, disconnect now.
220-
220-For statistics, see http://ftp.surfnet.nl/.statistics/
220-Problems?  Mail ftpmirror-beheer @ surfnet.nl
220-
220-You may login as "ftp" or "anonymous".
220-
220
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type

Now we are asked to login and we will use the name "anonymous":

Name (ftp.nluug.nl:bruno): anonymous
331 Please specify the password.

And give a password ( in most cases your email address ):

Password:  ********
230-
230-================================================================
230-Want to know where to find what data?  See the file
230-                                        /pub/WhereToFindWhat.txt
230-
230-================================================================
230-
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

Now we get the FTP prompt and we can cd to the directory where the
file is located: ( Note, next to the cd command also ls and pwd are
commands known by FTP, but more about that later )

ftp>  cd /pub/os/Linux/distr/damnsmall/current/
250 Directory successfully changed.

Next we are going to download the file:

ftp>  get dsl-1.3.1.iso
local: dsl-1.3.1.iso remote: dsl-1.3.1.iso
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for dsl-1.3.1.iso (50745344 bytes).
226 File send OK.
50745344 bytes received in 1.5e+02 seconds (3.3e+02 Kbytes/s)

And after seeing "File send OK" you can close the connection and get
your usual prompt back:

ftp>  bye
221 Goodbye.
[bruno:~]$

If you want to see a full list of commands that your FTP program can
handle just type a ? at the FTP prompt:

ftp>  ?

-- 
??????????. ?

Kanchi Linux User Group Rocks !

http://kanchilug.wordpress.com

My Experiments In Linux are here

http://gnutuxfollower.wordpress.com

Other related posts:

  • » [Ilugc] FTP on the COMMANDLINE - Vishnu Raj