Home » 2014 » February » 5 » How do we use FTP from command line to send and receive files

5:24 PM
How do we use FTP from command line to send and receive files
FTP is protocol used to send and receive files from an FTP server or a remote computer.
 
Using this tool, one can send , receive single or multiple files, can write or open to a local or remote file, create or delete a directory on a remote server/computer.

To establish an FTP connection to a remote computer or a FTP server we have to use below command in windows command prompt:
 
ftp ftpserver
The ftpserver here could  be ftp server to connect to or ip address of remote computer.This command prompts for a username and password.
 
If one has an account to remote computer, you have to enter the username and then password. Some FTP server also provides anonymous access. Eg. ftp://ftp.hq.nasa.gov/ 
 
 For that, when it prompts for username, enter "anonymous" and for password, enter email-id.
 
Once the credentials are fed properly, a connection is established and ftp returns a prompt.
 
C:\Users\shanky>ftp shankys.ucoz.com
Connected to shankys.ucoz.com.
220---------- Welcome to Pure-FTPd ----------
220-You are user number 5 of 100 allowed.
220-Local time is now 21:24. Server port: 21.
220-This is a private system - No anonymous login
220 You will be disconnected after 15 minutes of inactivity.
User (shankys.ucoz.com:(none)): dshankys
331 User dshankys OK. Password required
Password:
230-User dshankys has group access to:  1002
230-OK. Current restricted directory is /
230-581 files used (2%) - authorized: 25600 files
230 343763 Kbytes used (82%) - authorized: 417792 Kb
ftp>

 
Now you can start using ftp features. Here type "help" and press "Enter".
You will get a list of command that can be used inside ftp prompt.
ftp>help

ftp> help
Commands may be abbreviated.  Commands are:
!               delete          literal         prompt          send
?               debug           ls              put             status
append          dir             mdelete         pwd             trace
ascii           disconnect      mdir            quit            type
bell            get             mget            quote           user
binary glob mkdir recv verbose
bye             hash            mls             remotehelp
cd              help            mput            rename
close           lcd             open            rmdir
 
Now, use dir commad to list all the files and directory in the current commad.
You can navigate to another directory using "cd" command.
 
  • To get a file from remote server
To get a file from the current directory at remote server to the current directory of your local system, use below command:
 get <filename>
The file will be copied from the remote computer to the current directory of local system.
 
  • To send a file to remote computer
To send a file from your current directory to remote computer, use below command:
put <filename>
Note:- Any time if you get a messaage like "Not connected", that means the connection is not established to the remote computer or it is lost. You need to re-connect in this case.
 
 
 

Category: Technical Solution | Views: 988 | Added by: shanky | Rating: 0.0/0

Related blogs


You may also like to see:


[2014-12-28][Technical Solution]
How to schedule a mail in outlook to be sent later?
[2014-01-29][Technical Solution]
How to create my own website for free?
[2014-03-01][Technical Solution]
RSS feed: what is it and how to use it?
[2014-12-28][Technical Solution]
JDBC connection to MS Access database or Oracle database using Java Program.
[2014-05-02][Technical Solution]
A very basic program in perl scripting

Total comments: 0
avatar