
A typical FTP (File Transfer Protocol) session goes like:
(1) open a remote host with an FTP server running.
(2) login
(3) create or copy to or copy from files, etc
(4) close the connection
Sample:
connecting to a remote host:
* on the command prompt, simply type in: ftp ip_address
* or, type in ftp and then on the ftp prompt, type open ip_address
login
* enter with your username and password
* this account is created by the Admin of the remote host you are connecting to
perform FTP transactions
* display all commands by typing: help
* list the files on the remote server by typing: ls
* put a file to the remote server by typing: put filename
* get a file from the remote server by typing: get filename
close the connection
* simply type: bye
An FTP session can also be automated by using script files.
When using a Windows machine.
(1) create a script file that contains the FTP commands you wanted to perform, say we named it script.txt and has the following contents:
open ip_address
username
password
ftp commands
bye
(2) then simply type in: ftp -s:script.txt on the command prompt to execute
When using a Linux machine.
Just create a shell script file that looks like the following:
#!/bin/sh
ftp -n -i ip_address <<EOF
user username password
ftp commands
bye
EOF
exit 0