-v - Suppresses verbose display of remote server responses.
-n - Suppresses auto-login upon initial connection.
-i - Turns off interactive prompting during multiple file transfers.
-d - Enables debugging, displaying all ftp commands passed between the client and server.
-g - Disables filename globbing, which permits the use of wildcard chracters in local file and path names.
-s:filename - Specifies a text file containing ftp commands; the commands will automatically run after ftp starts. No spaces are allowed in this parameter. Use this switch instead of redirection (>).
-a - Use any local interface when binding data connection.
-w:windowsize - Overrides the default transfer buffer size of 4096.
computer - Specifies the computer name or IP address of the remote computer to connect to. The computer, if specified, must be the last parameter on the line.
Some Common FTP Commands
Open hostname – connects you to a ftp server
Bin – sets you to binary mode
Hash – shows those hash marks as you copy files
Cd – Change remote directory
Lcd – change local directory
Get – download a file
Mget – copies one or more remote files to the local computer
Put or send – upload a file
Delete – Deletes a file
Bye – ends your session
Disconnect – disconnects from the curent host, but keeps the ftp prompt up
Example
Its pretty simple,
FTP acme.txt to my ftp server as newfile.txt
Login; student
Password; password
script.txt will look something like this
open r2d2
student
password
hash
bin
put acme.txt newfile.txt
bye
Batch file (script.bat) or command to run the script
ftp -s:script.txt
Sample Output - Success
C: esting123>script.bat
C: esting123>ftp -s:script.txt
ftp> open r2d2
Connected to r2d2.
220 Welcome to Quick 'n Easy FTP Server
User (r2d2:(none)):
331 Password required for student
230 User successfully logged in.
ftp> hash
Hash mark printing On ftp: (2048 bytes/hash mark) .
ftp> bin
200 Type set to BINARY
ftp> put acme.txt newfile.txt
200 Port command successful.
150 Opening BINARY mode data connection for file transfer.
226 Transfer complete
ftp: 1 bytes sent in 0.00Seconds 1000.00Kbytes/sec.
ftp> bye
221 Bye
Wireshark Training - QuickStart Tony Fortunato, Sr Network Specialist The Technology Firm Thank you
For additional educational videos on Open Source Network Tools, please click on the following …
Tony Fortunato is a Senior Network Specialist with more
Tony Fortunato is a Senior Network Specialist with experience in design, implementation, and troubleshooting of LAN/WAN/Wireless networks, desktops and servers since 1989. His background in financial networks includes design and implementation of trading floor networks. Tony has taught at local high schools, Colleges/Universities, Networld/Interop and many onsite private classroom settings to thousands of analysts. less
0 comments
Post a comment