Monday, December 29, 2014

FTP via Command Prompt (Windows)

FTP via Command Prompt (Windows)
To FTP a particular server we have to perform following 2 operations:
  1. Connect to server.
  2. Download/Upload files.

To connect to server please following steps:
  1. Create a local directory (to upload and download files)
  2. Go to Command Prompt. Run > CMD > Enter
  3. Go to local directory using CD.. or CD\


  4. Run following command:
    1. ftp server_address and hit ENTER
  5. it will ask for username . enter username and hit ENTER
  6. now it will ask for password. Enter password and hit ENTER


now you are connected to server.
Use LS command to list all the files and directories on the server. Again to go to selected directory use CD command for example CD My_Dir.

To download file:
Use GET command to download file.

Similarly use PUT command to upload file to the desired location.

Same way we can upload multiple files and perform other FTP operations. Following are few commands for FTP:
Command
Information
!
This command toggles back and forth between the operating system and ftp.
Once back in the operating system, typing exit takes you back to the FTP command line.
?
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.

dir -C = Will list the files in wide format.
dir -1 = Lists the files in bare format in alphabetic order
dir -r = Lists directory in reverse alphabetic order.
dir -R = Lists all files in current directory and sub directories.
dir -S = Lists files in bare format in alphabetic order.
disconnect
Exits from FTP.
get
Get file from the computer connected to.
glob
Sets globbing on or off. When turned off the file name in the put and get 
commands is taken literally and wildcards will not be looked at.
hash
Sets hash mark printing on or off. 
When turned on for each 1024 bytes of data received a hash-mark (#) is displayed.
help
Access the Help screen and displays information about command 
if command typed after help.
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:

Post a Comment