Tuesday 29 November 2016

FTP from command prompt

What is FTP?

  • FTP is a standard network protocol used to transfer computer files between a client and server on a computer network.
  • FTP is built on a client-server model architecture and uses separate control and data connections between the client and the server.


How to use FTP from command prompt?

  • Open command prompt and type the command "ftp [domain name or FTP IP address]" to connect your server.
  • You can find the FTP IP address from control panel under the FTP account details.
  • Once you hit enter it will attempt to connect to the server.
  • If it is successful, you will be prompted for a username and password. Enter the FTP username and password information to login.
  • Once you have Logged in, you should see a line like ftp>.


FTP syntax

ftp [-v] [-d] [-i] [-n] [-g] [-s:FileName] [-a] [-w:WindowSize] [-A] [Host]
  • FTP command line parameter are case sensitive.
  • You must prefix ftp parameter with hyphen (-) rather than a slash (/).
  • This command is available only if the internet protocol (TCP/IP) is installed as a component in the properties of a network adapter in network connections.
Parameters
Parameters Description
-v Suppresses the display of FTP server responses.
-d Enables debugging, displaying all commands passed between the FTP client and FTP server.
-i Disables interactive prompting during multiple file transfers.
-n Suppresses the ability to log on automatically when the initial connection is made.
-g Disables file name globing. Glob permits the use of the asterisk (*) and question mark (?) as wildcard characters in local file and path names.
-s:FileName Specifies a text file that contains ftp commands. These commands run automatically after ftp starts. This parameter allows no spaces. Use this parameter instead of redirection (<).
-a Specifies that any local interface can be used when binding the FTP data connection.
-w Specifies the size of the transfer buffer. The default window size is 4096 bytes.
-A Logs onto the FTP server as anonymous.
Host Specifies the computer name, IP address, or IPv6 address of the FTP server to which to connect. The host name or address, if specified, must be the last parameter on the line.


Sub commands
Commands Description
! This command toggles back and forth between the operating system and ftp.
? Access the Help screen.
append Append text to a local file.
ascii Switch to ASCII transfer mode.
bell Turns bell mode on or off.
binary Switches to binary transfer mode.
bye Exits from FTP.
cd Changes directory.
close Exits from FTP.
delete Deletes a file.
debug Sets debugging on or off.
dir Lists files if connected.
get Grabs file from the computer to which you are connected.
hash Sets hash mark printing on or off. When turned on for each 1024 bytes of data received a hash-mark (#) is displayed.
lcd Displays local directory if typed alone or if path typed after lcd will change local directory.
literal Sends a literal command to the connected computer with an expected one line response.
ls Lists files of the remotely connected computer.
mdelete Multiple delete.
mdir Lists contents of multiple remote directories.
mget Get multiple files.
mkdir Make directory.
mls Lists contents of multiple remote directories.
mput Sent multiple files.
open Opens address.
prompt Enables or disables the prompt.
put Send one file.
pwd Print working directory.
quit Exits from FTP.
quote Same as the literal command.
recv Receive file.
remotehelp Get help from remote server.
rename Renames a file.
rmdir Removes a directory on the remote computer.
send Send single file.
status Shows status of currently enabled and disabled options.
trace Toggles packet tracing.
Type Set file transfer type.
user Send new user information.
verbose Sets verbose on or off.

No comments: