FTP using list of commands in a text file
Typing out ftp commands each time is error prone and no fun. Here’s an easy way to list all the commands in a text file and supply them sequentially to the ftp command.
ftp -s:ftpcommands.txt
Here’s a sample ftpcommands.txt
file:
The prompt
in there turns off prompt mode so commands such as mput
or mget
aren’t stuck waiting for user confirmation.
Transmitting non-text files
There are two modes of file transfer.
- ASCII- this only works for text because it assumes everything in the file can be encoded using ASCII characters
- Binary- uses more bytes to transfer but works for any type of files.