FTP Notes

Download this outline (Right-click to download, Left-click to open in browser). This assists the user in using the built-in FTP command line program.

Contents

  1. About
  2. Command List
  3. Brief Instructions
  4. Ftp
  5. Link to Helpful site with Many useful PC terms, etc.
  6. Ftp: !
  7. Ftp: ?
  8. Ftp: append
  9. Ftp: ascii
  10. Ftp: bell
  11. Ftp: binary
  12. Ftp: bye
  13. Ftp: cd
  14. Ftp: close
  15. Ftp: debug
  16. Ftp: delete
  17. Ftp: dir
  18. Ftp: disconnect
  19. Ftp: get
  20. Ftp: glob
  21. Ftp: hash
  22. Ftp: help
  23. Ftp: lcd
  24. Ftp: literal
  25. Ftp: ls
  26. Ftp: mdelete
  27. Ftp: mdir
  28. Ftp: mget
  29. Ftp: mkdir
  30. Ftp: mls
  31. Ftp: mput
  32. Ftp: open
  33. Ftp: prompt
  34. Ftp: put
  35. Ftp: pwd
  36. Ftp: quit
  37. Ftp: quote
  38. Ftp: recv
  39. Ftp: remotehelp
  40. Ftp: rename
  41. Ftp: rmdir
  42. Ftp: send
  43. Ftp: status
  44. Ftp: trace
  45. Ftp: type
  46. Ftp: user
  47. Ftp: verbose
  48. Free_ftp
  49. Links
  50. FTP Folder

1. About

This NoteTab Outline is a collection of instructions, links, command descriptions, and other useful information for using ftp.exe that comes with Windows 95/98/ME/NT/2000/XP. This should enable the NoteTab user to develop or modify clips to assist them with their FTP needs. See http://www.notetab.com, for more information on NoteTab and NoteTab Outlines.

On Win9x ftp.exe is in the C:\Windows directory. On WinNT derivatives ftp.exe is in the C:\WinNT\System32 directory.

The NoteTab programmable text editor can access the ftp.exe via its clip scripting language, and can even create, edit, and store clips that can be edited with NoteTab.

This outline was compiled by Lawrence M. (Larry) Hamilton, Jr.(www.kairoscomputers.com)
I used http://www.google.com to help me find sites with information on FTP commands for ftp.exe. If you have any other helpful information related to ftp, please let me know! Nearly all of these commands should work with FTP on any Operating System, such as, Unix or Linux.

Thanks to Larry Thomas for his Clipstor clip library, which makes compiling outlines by just copying what you want under a topic to the clipboard.

As with any information of this type, the user is advised to use caution and make sure they have a backup of their data. It is the user’s responsibility to insure that this information is correct before proceeding.

Top of Page ]

2. Command List

ftp> help
Commands may be abbreviated. Commands are:

! delete literal prompt send
? debug ls put status
append dir mdelete pwd trace
ascii disconnect mdir quit type
bell get mget quote user
binary glob mkdir recv verbose
bye hash mls remotehelp
cd help mput rename
close lcd open rmdirTop of Page ]

3. Brief Instructions

Local Directory is the place the program is looking for files on the machine you are at.
Remote Directory is the ip address the program connected to and the directory it is currently in.
Commands:
ascii
ascii uses the ascii connection to download and upload files, this should be used before transferring text or html files.
binary
binary uses the binary connection to download and upload files, this should be used before transferring executable or picture files.
ls
ls lists the contents of the remote directory.
cd directoryname
cd can be used to change the current remote directory.
lcd directoryname
lcd can be used to change the current local directory.
put filename
put takes the file filename from the local directory and copies it to the remote directory.
get filename
get takes the file filename from the remote directory and copies it to the local directory.

Top of Page ]

4. Ftp

Ftp

Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively. See ftp commands for a description of available ftp commands. This command is available only if the TCP/IP protocol has been installed.

ftp [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [computer]

Parameters

-v

Suppresses 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 characters in local file and path names. (See the glob command in the online Command Reference.)

-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.Top of Page ]

5. Link to Helpful site with Many useful PC terms, etc.

Link to Helpful site with Many useful PC terms, etc.

This is where I got all the individual FTP command information and the information on the FTP parameters.

http://www.cotse.com/Ntcommands/ntcmdsuntitled00000472.html#47de54ea

Top of Page ]

6. Ftp: !

Ftp: !

Runs the specified command on the local computer.

! command

Parameter

command

Specifies the command to run on the local computer. If command is omitted, the local command prompt is displayed; type exit to return to ftp

Top of Page ]

7. Ftp: ?

Ftp: ?

Displays descriptions for ftp commands. ? is identical to help.

? [command]

Parameter

command

Specifies the name of the command about which you want a description. If command is not specified, ftp displays a list of all commands.

Top of Page ]

8. Ftp: append

Ftp: append

Appends a local file to a file on the remote computer using the current file type setting.

append local-file [remote-file]

Parameters

local-file

Specifies the local file to add.

remote-file

Specifies the file on the remote computer to which local-file will be added. If remote-file is omitted, the local filename is used for the remote filename.

Top of Page ]

9. Ftp: ascii

Ftp: ascii

Sets the file transfer type to ASCII, the default.

ascii

Note

 FTP supports two file transfer types, ASCII and binary image. ASCII should be used when transferring text files. See also binary.

In ASCII mode, character conversions to and from the network standard character set are performed. For example, end-of-line characters are converted as necessary, based on the target operating system.

Top of Page ]

10. Ftp: bell

Ftp: bell

Toggles a bell to ring after each file transfer command is completed. By default, the bell is off.

bell

Top of Page ]

11. Ftp: binary

Ftp: binary

Sets the file transfer type to binary.

binary

Note

 FTP supports two file transfer types, ASCII and binary image. Binary should be used when transferring executable files. In binary mode, the file is moved byte-by-byte. See also ascii.

Top of Page ]

12. Ftp: bye

Ftp: bye

Ends the FTP session with the remote computer and exits ftp.

bye

Top of Page ]

13. Ftp: cd

Ftp: cd

Changes the working directory on the remote computer.

cd remote-directory

Parameter

remote-directory

Specifies the directory on the remote computer to change to.

Top of Page ]

14. Ftp: close

Ftp: close

Ends the FTP session with the remote server and returns to the command interpreter.

close

Top of Page ]

15. Ftp: debug

Ftp: debug

Toggles debugging. When debugging is on, each command sent to the remote computer is printed, preceded by the string —>. By default, debugging is off.

debug

Top of Page ]

16. Ftp: delete

Ftp: delete

Deletes files on remote computers.

delete remote-file

Parameter

remote-file

Specifies the file to delete.

Top of Page ]

17. Ftp: dir

Ftp: dir

Displays a list of a remote directory’s files and subdirectories.

dir [remote-directory] [local-file]

Parameters

remote-directory

Specifies the directory for which you want to see a listing. If no directory is specified, the current working directory on the remote computer is used. {I found that I had to do the same as mdir to make it work: “type – to use the current working directory on the remote computer.”}

local-file

Specifies a local file to store the listing. If not specified, output is displayed on the screen.

See Also: mdir ls mls

Top of Page ]

18. Ftp: disconnect

Ftp: disconnect

Disconnects from the remote computer, retaining the ftp prompt.

disconnect

Top of Page ]

19. Ftp: get

Ftp: get

Copies a remote file to the local computer using the current file transfer type.

get remote-file [local-file]

Parameters

remote-file

Specifies the remote file to copy.

local-file

Specifies the name to use on the local computer. If not specified, the file is given the remote-file name.

Top of Page ]

20. Ftp: glob

Ftp: glob

Toggles filename globbing. Globbing permits use of wildcard characters in local file or path names. By default, globbing is on.

glob

Top of Page ]

21. Ftp: hash

Ftp: hash

Toggles hash-sign (#) printing for each data block transferred. The size of a data block is 2048 bytes. By default, hash mark printing is off.

hash

Top of Page ]

22. Ftp: help

Ftp: help

Displays descriptions for ftp commands.

help [command]

Parameter

command

Specifies the name of the command about which you want a description. If command is not specified, ftp displays a list of all commands.

Top of Page ]

23. Ftp: lcd

Ftp: lcd

Changes the working directory on the local computer. By default, the working directory is the directory in which ftp was started.

lcd [directory]

Parameter

directory

Specifies the directory on the local computer to change to. If directory is not specified, the current working directory on the local computer is displayed.

Top of Page ]

24. Ftp: literal

Ftp: literal

Sends arguments, verbatim, to the remote FTP server. A single FTP reply code is expected in return.

literal argument [ …]

Parameter

argument

Specifies the argument to send to the FTP server.

Top of Page ]

25. Ftp: ls

Ftp: ls

Displays an abbreviated list of a remote directory’s files and subdirectories.

ls [remote-directory] [local-file]

Parameters

remote-directory

Specifies the directory for which you want to see a listing. If no directory is specified, the current working directory on the remote computer is used. {I found that I had to do the same as mdir to make it work: “type – to use the current working directory on the remote computer.”}

local-file

Specifies a local file to store the listing. If not specified, output is displayed on the screen.

See Also: dir mdir mls

Top of Page ]

26. Ftp: mdelete

Ftp: mdelete

Deletes files on remote computers.

mdelete remote-files [ …]

Parameter

remote-files

Specifies the remote files to delete.

Top of Page ]

27. Ftp: mdir

Ftp: mdir

Displays a list of a remote directory’s files and subdirectories. Mdir allows you to specify multiple files.

mdir remote-files [ …] local-file

Parameters

remote-files

Specifies the directory for which you want to see a listing. Remote-files must be specified; type – to use the current working directory on the remote computer.

local-file

Specifies a local file to store the listing. Type – to display the listing on the screen.

See Also: dir ls mls

Top of Page ]

28. Ftp: mget

Ftp: mget

Copies remote files to the local computer using the current file transfer type.

mget remote-files [ …]

Parameter

remote-files

Specifies the remote files to copy to the local computer.

==========================================
Differences between this command and ‘get’ (From “Michael Gerholdt” <gerholdt@fredonia.edu>)

You cannot rename files or specify their location as a parameter of
‘mget’ as you can with ‘get’

Therefore it is necessary to use ‘lcd’ (local change directory) before
using mget and then rename the files after download if that is
necessary.

=========================
MGET and the wildcard (*)

ftp> mget fyr*

and you will be prompted for all files with name starting with the
letters “fyr”

MGET and PROMPT

The above example will prompt you for a yes/no response before it gets
each file. If you would like to not be prompted, just use

ftp> prompt

Note that if you do this you will download ALL files that match “fyr”.
If you know there are some that you do not want, leave prompting
toggled on.

Top of Page ]

29. Ftp: mkdir

Ftp: mkdir

Creates a remote directory.

mkdir directory

Parameter

directory

Specifies the name of the new remote directory.

Top of Page ]

30. Ftp: mls

Ftp: mls

Displays an abbreviated list of a remote directory’s files and subdirectories.

mls remote-files [ …] local-file

Parameters

remote-files

Specifies the files for which you want to see a listing. Remote-files must be specified; type – to use the current working directory on the remote computer. {I found that I had to do the same as mdir to make it work: “type – to use the current working directory on the remote computer.”}

local-file

Specifies a local file to store the listing. Type – to display the listing on the screen.

See Also: dir mdir ls

Top of Page ]

31. Ftp: mput

Ftp: mput

Copies local files to the remote computer using the current file transfer type.

mput local-files [ …]

Parameter

local-files

Specifies the local files to copy to the remote computer.

Top of Page ]

32. Ftp: open

Ftp: open

Connects to the specified FTP server.

open computer [port]

Parameters

computer

Specifies the remote computer to connect to. Computer can be specified by IP address or computer name (a DNS or HOSTS file must be available). If auto-login is on (default), FTP also attempts to automatically log the user in to the FTP server (see Ftp to disable auto-login).

port

Specifies a port number to use to contact an FTP server.

Top of Page ]

33. Ftp: prompt

Ftp: prompt

Toggles prompting. Ftp prompts during multiple file transfers to allow you to selectively retrieve or store files; mget and mput transfer all files if prompting is turned off. By default, prompting is on.

prompt

Top of Page ]

34. Ftp: put

Ftp: put

Copies a local file to the remote computer using the current file transfer type.

put local-file [remote-file]

Parameters

local-file

Specifies the local file to copy.

remote-file

Specifies the name to use on the remote computer. If not specified, the file is given the local-file name.

Top of Page ]

35. Ftp: pwd

Ftp: pwd

Displays the current directory on the remote computer.

pwd

Top of Page ]

36. Ftp: quit

Ftp: quit

Ends the FTP session with the remote computer and exits ftp.

quit

Top of Page ]

37. Ftp: quote

Ftp: quote

Sends arguments, verbatim, to the remote FTP server. A single FTP reply code is expected in return. Quote is identical to literal.

quote argument [ …]

Parameter

argument

Specifies the argument to send to the FTP server.

Top of Page ]

38. Ftp: recv

Ftp: recv

Copies a remote file to the local computer using the current file transfer type. Recv is identical to get.

recv remote-file [local-file]

Parameters

remote-file

Specifies the remote file to copy.

local-file

Specifies the name to use on the local computer. If not specified, the file is given the remote-file name.

Top of Page ]

39. Ftp: remotehelp

Ftp: remotehelp

Displays help for remote commands.

remotehelp [command]

Parameter

command

Specifies the name of the command about which you want help. If command is not specified, ftp displays a list of all remote commands.

Following is a list of the remotehelp command that I captured to a text file, since they scroll by so fast they are unreadable. This is from a Unix web server. I did not have time to get more information on the various commands. I did try some of them, but only got invalid command messages. I tried to get help on them but same message. If anyone has any information on these, some are same as the commands I have already listed, but any information on the “new” ones would be greatly appreciated. Perhaps they are commands that require special permissions to use.

ftp> remotehelp
214-The following commands are recognized(* ==>’s unimplemented).
   ABOR
   ACCT
   ALLO
   APPE
   CDUP
   CWD
   DELE
   HELP
   LIST
   MKD
   MODE
   NLST
   NOOP
   PASS
   PASV
   PORT
   PWD
   QUIT
   REIN
   REST
   RETR
   RMD
   RNFR
   RNTO
   SITE
   SIZE
   SMNT
   STAT
   STOR
   STOU
   STRU
   SYST
   TYPE
   USER
   XCUP
   XCWD
   XMKD
   XPWD
   XRMD

Top of Page ]

40. Ftp: rename

Ftp: rename

Renames remote files.

rename filename newfilename

Parameters

filename

Specifies the file you want to rename.

newfilename

Specifies the new filename.

Top of Page ]

41. Ftp: rmdir

Ftp: rmdir

Deletes a remote directory.

rmdir directory

Parameter

directory

Specifies the name of the remote directory to delete.

Top of Page ]

42. Ftp: send

Ftp: send

Copies a local file to the remote computer using the current file transfer type. Send is identical to put.

send local-file [remote-file]

Parameters

local-file

Specifies the local file to copy.

remote-file

Specifies the name to use on the remote computer. If not specified, the file is given the local-file name.

Top of Page ]

43. Ftp: status

Ftp: status

Displays the current status of FTP connections and toggles.

status

Top of Page ]

44. Ftp: trace

Ftp: trace

Toggles packet tracing; trace displays the route of each packet when running an ftp command.

trace

Top of Page ]

45. Ftp: type

Ftp: type

Sets or displays the file transfer type.

type [type-name]

Parameter

type-name

Specifies the file transfer type; the default is ASCII. If type-name is not specified, the current type is displayed.

Notes

 FTP supports two file transfer types, ASCII and binary image.

 ASCII should be used when transferring text files. In ASCII mode, character conversions to and from the network standard character set are performed. For example, end-of-line characters are converted as necessary, based on the destination’s operating system.

 Binary should be used when transferring executable files. In binary mode, the file is moved byte-by-byte.

See Also

 ascii

 binary

Top of Page ]

46. Ftp: user

Ftp: user

Specifes a user to the remote computer.

user user-name [password] [account]

Parameters

user-name

Specifies a user name with which to log in to the remote computer.

password

Specifies the password for user-name. If not specified, but required, ftp prompts for the password.

account

Specifies an account with which to log on to the remote computer. If account is not specified, but required, ftp prompts for the account.

Top of Page ]

47. Ftp: verbose

Ftp: verbose

Toggles verbose mode. If on, all ftp responses are displayed; when a file transfer completes, statistics regarding the efficiency of the transfer are also displayed. By default, verbose is on.

verbose

Top of Page ]

48. Free_ftp

Free_ftp

{This should give enough ideas for the NoteTab User to automate the use of FTP for their Web Site(s) needs.}

http://www.internet-95.com/company/starship/free_ftp.htm NOTE: This is now a dead link.

Free_ftp is a free batch file that allows you to instantly update you website in seconds using windows built in ftp software. It requires Windows 95 or better. You simply have to copy three small text files and edit them and create three directories on your hard drive.
Step One
 
Create a directory “free_ftp” on your hard drive. Then under that directory create one called “ascii” and one called “binary”
Step Two
Open notepad and with your mouse copy and paste the text below into a new file and save it in your “free_ftp” directory as “free_ftp.bat”
@echo off
cls

:top
cls
echo Free_ftp will go into PAUSE in 30 seconds.
CHOICE /C:ABPX /T:P,30 A=Ascii B=Binary P=Pause X=Exit
if errorlevel 4 goto term
if errorlevel 3 goto sleep
if errorlevel 2 goto binary
if errorlevel 1 goto ascii
goto top

:ascii
if not exist c:\free_ftp\ascii\index.htm goto top
ftp.exe -s:ascii.txt
del c:\free_ftp\ascii\index.htm
goto top

:binary
if not exist c:\free_ftp\binary\image.jpg goto top
ftp.exe -s:binary.txt
del c:\free_ftp\binary\image.jpg
goto top

:sleep
echo Free_ftp is now in pause mode.
pause
goto top

:term
Echo Free_ftp Terminated!
 
Step Three
Edit “free_ftp.bat” inserting the name of any text file you want to upload in place of the file name “index.htm” in lines 13 and 15. In lines 18 and 20 replace “image.jpg” with any binary file name you want to upload.
Step Four
Copy the two files below and save them into directory “free_ftp” as ascii.txt and binary.txt

 
ascii.txt:

open ftp.server.com
username
password
cd \directory\path\
ascii
hash
send c:\free_ftp\ascii\index.htm
quit
 
 
binary.txt:

open ftp.server.com
username
password
cd \directory\path\
binary
hash
send c:\free_ftp\binary\image.jpg
quit

Step Five
Edit ascii.txt and binary.txt replacing “ftp.server.com” with the name of your servers ftp client.
Replace “username” with your user name,
replace “password” with your password.
Edit “directory\path\” to the directory on your server you want the files uploaded to
Edit “index.htm” and “image.jpg” to the file names you want to send.
Setup
In Windows95 click “Start” then “settings” then “taskbar”
Click “start menu programs” then “add”
In command line type or browse for:
c:\free_ftp\free_ftp.bat
click “next” choose “programs” or another directory
click “next” for shortcut name type “Free_ftp”
click “next” choose an icon, then “finish”
Operation
Whenever you have to update your website copy or save the text file into c:\free_ftp\ascii\ and the binary file into c:\free_ftp\binary\
run free_ftp and press “A” to send the ascii file or “B” to send the binary.
If no action is taken after 30 seconds free_ftp will automatically go into pause.
Free_ftp will delete the files after uploading so save a copy elsewhere if you don’t want to loose them. Press “X” to exit

Top of Page ]

49. Links

These are the links I found the most helpful, check them out.

http://www.cotse.com/Ntcommands/ntcmdsuntitled00000472.html#47de54ea

http://www.imsa.edu/~grung/ftphelp.html NOTE: This web page is now just a note that it is no longer there.

http://www.internet-95.com/company/starship/free_ftp.htm NOTE: This is now a dead link.

http://www.conpub.com/main/docs/FTP_HowTo.htm#GuidedTour_DOS_UNIX NOTE: This is now a dead link.

http://www.eas.asu.edu/~cse200/ftp.faq.html NOTE: This is now a dead link.

http://www.zdnet.com/pcmag/pctech/content/18/01/iu1801.003.html NOTE: This is now a dead link.

http://html.tucows.com/webmaster/tut/dosftp.html

http://ocean.otr.usm.edu/~dunsfor/tips/useftp.htm NOTE: This is now a dead link.

Here is a beginner’s Tutorial Eric Fookes sent me:
How to use FTP http://www.relia.net/~jerry/website/ftp.html

Top of Page ]

50. FTP Folder

>I have access to the ftp commands on my site. How do I
>make an anonymous login to a specific folder for download
>via ftp?
>
>Thanks!
>Jody

usr: anonymous
pw: e-mail address

Then type:

cd [directory]

ls [same as DOS dir]

help [to get help]

Easy, isn’t it?

Bye!

Marco Bernardini