Tuesday 3 July 2012

Working with FTP using commands

Examples

The command list is some what exhaustive. So we will see,  practically how to work with them.

After configuring FTP on Windows Server 2008, start the client machine. 
Start Command Prompt : Start -> Run -> cmd -> OK

1. Connecting to the ftp server

ftp mcitp.com
Enter username 
Enter password
.. and you are connected. Now fire the ftp commands as per your need.


2. List the files in the remote directory

ftp> ls


3. Create a remote directory


ftp> mkdir DirectoryName

4. Change the directory


ftp> cd DirectoryName

5. Check the remote directory path


ftp> pwd


6. Copy a file from the local machine to the remote machine


ftp> put FilePath




7. Copy more than one file from the local machine to the remote machine


I want to copy the all the notepad(.txt) files from my local machine to the remote machine

ftp> mput *.txt

You will be asked at the time of transferring each file. Based on your answer (y/n) the action will be performed.


8. Copy a file from the remote machine to the local machine

Before transferring the file


ftp> get FileName




.... and the file is transferred.



9. Copy more than one file from the remote machine to the local machine


Before transferring files ..


Copy the all the files from remote local machine to my local machine
(remote machine folder is /MyFolder)

ftp> get *




.... and the files are transferred.



10. Exit the FTP environment

There are two commands to exit the FTP environment.

ftp> bye


or the other command is

ftp> quit





FTP Command List & Description

Command
Description
!
Preceding a command with the exclamation point will cause the command to execute on the local system instead of the remote system.
?
Request assistance or information about the FTP commands. This command does not require a connection to a remote system.
ascii
Set the file transfer mode to ASCII (Note: this is the default mode for most FTP programs).
binary
Set the file transfer mode to binary (Note: the binary mode transfers all eight bits per byte and must be used to transfer non-ASCII files).
bye
Exit the FTP environment (same as quit). This command does not require a connection to a remote system.
cd
Change directory on the remote system.
close
Terminate a session with another system.
delete
Delete (remove) a file in the current remote directory (same as rm in UNIX).
dir
Lists the contents of the remote directory.The asterisk (*) and the question mark (?) may be used as wild cards. For example:
get
WIP
help
Request a list of all available FTP commands. This command does not require a connection to a remote system.
lcd
Change directory on your local system (same as CD in UNIX).
ls
List the names of the files in the current remote directory.
mget
WIP
mkdir
Make a new directory within the current remote directory.
mput
Copy multiple files from the local system to the remote system. (Note: You will be prompted for a "y/n" response before copying each file).
open
Open a connection with another system.
put
Copy a file from the local system to the remote system.
pwd
Find out the pathname of the current directory on the remote system.
quit
Exit the FTP environment (same as "bye"). This command does not require a connection to a remote system.
rmdir
Remove (delete) a directory in the current remote directory.

No comments:

Post a Comment

Your comments are very much valuable for us. Thanks for giving your precious time.

Do you like this article?