-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrawftp.html
355 lines (351 loc) · 13 KB
/
rawftp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<META NAME="Description" CONTENT="List of raw FTP commands, this is a technical document, not necessary for most FTP use.">
<META NAME="Keywords" CONTENT="FTP commands">
<title>Raw FTP Command List | SS64.com</title>
<link rel="STYLESHEET" href="main.css" type="text/css">
<style>
code, tt, pre, samp {
font-family: "courier new", courier, "Andale Mono", monospace;
}
h3 {
font-family: Helvetica, Arial, Verdana, geneva, sans-serif;
font-weight:normal;
font-size: normal;
}
</style>
</head><h1>List of raw FTP commands</h1>
<i>This is a technical document, not necessary for most FTP
use.</i>
<!--mirrored from www.dreamhaven.org/ftp-raw.html -->
<p>Note that commands marked with * are not implemented in a number of
FTP servers.</p>
<h3>Common commands</h3>
<ul>
<li><a href="rawftp.html#ABOR">ABOR</a> - <b>abor</b>t a file transfer
<li><a href="rawftp.html#CWD">CWD</a> - <b>c</b>hange <b>w</b>orking <b>d</b>irectory
<li><a href="rawftp.html#DELE">DELE</a> - <b>dele</b>te a remote file
<li><a href="rawftp.html#LIST">LIST</a> - <b>list</b> remote files
<li><a href="rawftp.html#MDTM">MDTM</a> - return the <b>m</b>o<b>d</b>ification <b>t</b>i<b>m</b>e of a file
<li><a href="rawftp.html#MKD">MKD</a> - <b>m</b>a<b>k</b>e a remote <b>d</b>irectory
<li><a href="rawftp.html#NLST">NLST</a> - <b>n</b>ame <b>l</b>i<b>st</b> of remote directory
<li><a href="rawftp.html#PASS">PASS</a> - send <b>pass</b>word
<li><a href="rawftp.html#PASV">PASV</a> - enter <b>pas</b>si<b>v</b>e mode
<li><a href="rawftp.html#PORT">PORT</a> - open a data <b>port</b>
<li><a href="rawftp.html#PWD">PWD</a> - <b>p</b>rint <b>w</b>orking <b>d</b>irectory
<li><a href="rawftp.html#QUIT">QUIT</a> - terminate the connection
<li><a href="rawftp.html#RETR">RETR</a> - <b>retr</b>ieve a remote file
<li><a href="rawftp.html#RMD">RMD</a> - <b>r</b>e<b>m</b>ove a remote <b>d</b>irectory
<li><a href="rawftp.html#RNFR">RNFR</a> - <b>r</b>e<b>n</b>ame <b>fr</b>om
<li><a href="rawftp.html#RNTO">RNTO</a> - <b>r</b>e<b>n</b>ame <b>to</b>
<li><a href="rawftp.html#SITE">SITE</a> - <b>site</b>-specific commands
<li><a href="rawftp.html#SIZE">SIZE</a> - return the <b>size</b> of a file
<li><a href="rawftp.html#STOR">STOR</a> - <b>stor</b>e a file on the remote host
<li><a href="rawftp.html#TYPE">TYPE</a> - set transfer <b>type</b>
<li><a href="rawftp.html#USER">USER</a> - send <b>user</b>name
</ul>
<h3>Less common commands</h3>
<ul>
<li><a href="rawftp.html#ACCT">ACCT</a>* - send <b>acc</b>oun<b>t</b> information
<li><a href="rawftp.html#APPE">APPE</a> - <b>appe</b>nd to a remote file
<li><a href="rawftp.html#CDUP">CDUP</a> - CWD to the parent of the current directory
<li><a href="rawftp.html#HELP">HELP</a> - return <b>help</b> on using the server
<li><a href="rawftp.html#MODE">MODE</a> - set transfer <b>mode</b>
<li><a href="rawftp.html#NOOP">NOOP</a> - do nothing
<li><a href="rawftp.html#REIN">REIN</a>* - <b>rein</b>itialize the connection
<li><a href="rawftp.html#STAT">STAT</a> - return server <b>stat</b>us
<li><a href="rawftp.html#STOU">STOU</a> - <b>sto</b>re a file <b>u</b>niquely
<li><a href="rawftp.html#STRU">STRU</a> - set file transfer <b>stru</b>cture
<li><a href="rawftp.html#SYST">SYST</a> - return <b>syst</b>em type
</ul>
<hr>
<a name=ABOR></a>
<h3>ABOR</h3>
<i>Syntax:</i> <samp>ABOR</samp>
<p>
Aborts a file transfer currently in progress.
<p>
<a name=ACCT></a>
<h3>ACCT*</h3>
<i>Syntax:</i> <samp>ACCT <i>account-info</i></samp>
<p>
This command is used to send account information on systems that require it. Typically sent after a <a href="rawftp.html#PASS">PASS</a> command.
<p>
<a name=ALLO></a>
<h3>ALLO</h3>
<i>Syntax:</i> <samp>ALLO <i>size</i> [R <i>max-record-size</i>]</samp>
<p>
Allocates sufficient storage space to receive a file. If the maximum size of a record also needs to be known, that is sent as a second
numeric parameter following a space, the capital letter "R", and another space.
<p>
<a name=APPE></a>
<h3>APPE</h3>
<i>Syntax:</i> <samp>APPE <i>remote-filename</i></samp>
<p>
Append data to the end of a file on the remote host. If the file does not already exist, it is created. This command must be preceded by a
<a href="rawftp.html#PORT">PORT</a> or <a href="rawftp.html#PASV">PASV</a> command so that the server knows where to receive data from.
<p>
<a name=CDUP></a>
<h3>CDUP</h3>
<i>Syntax:</i> <samp>CDUP</samp>
<p>
Makes the parent of the current directory be the current directory.
<p>
<a name=CWD></a>
<h3>CWD</h3>
<i>Syntax:</i> <samp>CWD <i>remote-directory</i></samp>
<p>
Makes the given directory be the current directory on the remote host.
<p>
<a name=DELE></a>
<h3>DELE</h3>
<i>Syntax:</i> <samp>DELE <i>remote-filename</i></samp>
<p>
Deletes the given file on the remote host.
<p>
<a name=HELP></a>
<h3>HELP</h3>
<i>Syntax:</i> <samp>HELP [<i>command</i>]</samp>
<p>
If a <i>command</i> is given, returns help on that command; otherwise,
returns general help for the FTP server (usually a list of supported
commands).
<p>
<a name=LIST></a>
<h3>LIST</h3>
<i>Syntax:</i> <samp>LIST [<i>remote-filespec</i>]</samp>
<p>
If <i>remote-filespec</i> refers to a file, sends information about that
file. If <i>remote-filespec</i> refers to a directory, sends information
about each file in that directory. <i>remote-filespec</i> defaults to the
current directory. This command must be preceded by a
<a href="rawftp.html#PORT">PORT</a> or <a href="rawftp.html#PASV">PASV</a> command.
<p>
<a name=MDTM></a>
<h3>MDTM</h3>
<i>Syntax:</i> <samp>MDTM <i>remote-filename</i></samp>
<p>
Returns the last-modified time of the given file on the remote host in
the format "<samp>YYYYMMDDhhmmss</samp>": <samp>YYYY</samp> is the
four-digit year, <samp>MM</samp> is the month from 01 to 12,
<samp>DD</samp> is the day of the month from 01 to 31, <samp>hh</samp> is
the hour from 00 to 23, <samp>mm</samp> is the minute from 00 to 59, and
<samp>ss</samp> is the second from 00 to 59.
<p>
<a name=MKD></a>
<h3>MKD</h3>
<i>Syntax:</i> <samp>MKD <i>remote-directory</i></samp>
<p>
Creates the named directory on the remote host.
<p>
<a name=MODE></a>
<h3>MODE</h3>
<i>Syntax:</i> <samp>MODE <i>mode-character</i></samp>
<p>
Sets the transfer mode to one of:
<ul>
<li>S - Stream
<li>B - Block
<li>C - Compressed
</ul>
The default mode is Stream.
<p>
<a name=NLST></a>
<h3>NLST</h3>
<i>Syntax:</i> <samp>NLST [<i>remote-directory</i>]</samp>
<p>
Returns a list of filenames in the given directory (defaulting to the
current directory), with no other information. Must be preceded by a
<a href="rawftp.html#PORT">PORT</a> or <a href="rawftp.html#PASV">PASV</a> command.
<p>
<a name=NOOP></a>
<h3>NOOP</h3>
<i>Syntax:</i> <samp>NOOP</samp>
<p>
Does nothing except return a response.
<p>
<a name=PASS></a>
<h3>PASS</h3>
<i>Syntax:</i> <samp>PASS <i>password</i></samp>
<p>
After sending the <a href="rawftp.html#USER">USER</a> command, send this command to
complete the login process. (Note, however, that an <a href="rawftp.html#ACCT">ACCT</a>
command may have to be used on some systems.)
<p>
<a name=PASV></a>
<h3>PASV</h3>
<i>Syntax:</i> <samp>PASV</samp>
<p>
Tells the server to enter "passive mode". In passive mode, the server will
wait for the client to establish a connection with it rather than
attempting to connect to a client-specified port. The server will respond
with the address of the port it is listening on, with a message like:<br>
<samp>227 Entering Passive Mode (<i>a1</i>,<i>a2</i>,<i>a3</i>,<i>a4</i>,<i>p1</i>,<i>p2</i>)</samp><br>
where <i>a1</i>.<i>a2</i>.<i>a3</i>.<i>a4</i> is the IP address and
<i>p1</i>*256+<i>p2</i> is the port number.
<p>
<a name=PORT></a>
<h3>PORT</h3>
<i>Syntax:</i> <samp>PORT
<i>a1</i>,<i>a2</i>,<i>a3</i>,<i>a4</i>,<i>p1</i>,<i>p2</i></samp>
<p>
Specifies the host and port to which the server should connect for the next
file transfer. This is interpreted as IP address
<i>a1</i>.<i>a2</i>.<i>a3</i>.<i>a4</i>, port <i>p1</i>*256+<i>p2</i>.
<p>
<a name=PWD></a>
<h3>PWD</h3>
<i>Syntax:</i> <samp>PWD</samp>
<p>
Returns the name of the current directory on the remote host.
<p>
<a name=QUIT></a>
<h3>QUIT</h3>
<i>Syntax:</i> <samp>QUIT</samp>
<p>
Terminates the command connection.
<p>
<a name=REIN></a>
<h3>REIN*</h3>
<i>Syntax:</i> <samp>REIN</samp>
<p>
Reinitializes the command connection - cancels the current
user/password/account information. Should be followed by a
<a href="rawftp.html#USER">USER</a> command for another login.
<p>
<a name=REST></a>
<h3>REST</h3>
<i>Syntax:</i> <samp>REST <i>position</i></samp>
<p>
Sets the point at which a file transfer should start; useful for resuming
interrupted transfers. For nonstructured files, this is simply a decimal
number. This command must immediately precede a data transfer command
(<a href="rawftp.html#RETR">RETR</a> or <a href="rawftp.html#STOR">STOR</a> only); i.e. it must
come after any <a href="rawftp.html#PORT">PORT</a> or <a href="rawftp.html#PASV">PASV</a> command.
<p>
<a name=RETR></a>
<h3>RETR</h3>
<i>Syntax:</i> <samp> RETR <i>remote-filename</i></samp>
<p>
Begins transmission of a file from the remote host. Must be preceded by
either a <a href="rawftp.html#PORT">PORT</a> command or a <a href="rawftp.html#PASV">PASV</a>
command to indicate where the server should send data.
<p>
<a name=RMD></a>
<h3>RMD</h3>
<i>Syntax:</i> <samp>RMD <i>remote-directory</i></samp>
<p>
Deletes the named directory on the remote host.
<p>
<a name=RNFR></a>
<h3>RNFR</h3>
<i>Syntax:</i> <samp> RNFR <i>from-filename</i></samp>
<p>
Used when renaming a file. Use this command to specify the file to be
renamed; follow it with an <a href="rawftp.html#RNTO">RNTO</a> command to specify the
new name for the file.
<p>
<a name=RNTO></a>
<h3>RNTO</h3>
<i>Syntax:</i> <samp> RNTO <i>to-filename</i></samp>
<p>
Used when renaming a file. After sending an <a href="rawftp.html#RNFR">RNFR</a>
command to specify the file to rename, send this command to specify the
new name for the file.
<p>
<a name=SITE></a>
<h3>SITE*</h3>
<i>Syntax:</i> <samp>SITE <i>site-specific-command</i></samp>
<p>
Executes a site-specific command.
<p>
<a name=SIZE></a>
<h3>SIZE</h3>
<i>Syntax:</i> <samp>SIZE <i>remote-filename</i></samp>
<p>
Returns the size of the remote file as a decimal number.
<p>
<a name=STAT></a>
<h3>STAT</h3>
<i>Syntax:</i> <samp>STAT [<i>remote-filespec</i>]</samp>
<p>
If invoked without parameters, returns general status information about
the FTP server process. If a parameter is given, acts like the
<a href="rawftp.html#LIST">LIST</a> command, except that data is sent over the
control connection (no <a href="rawftp.html#PORT">PORT</a> or <a href="rawftp.html#PASV">PASV</a>
command is required).
<p>
<a name=STOR></a>
<h3>STOR</h3>
<i>Syntax:</i> <samp>STOR <i>remote-filename</i></samp>
<p>
Begins transmission of a file to the remote site. Must be preceded by
either a <a href="rawftp.html#PORT">PORT</a> command or a <a href="rawftp.html#PASV">PASV</a>
command so the server knows where to accept data from.
<p>
<a name=STOU></a>
<h3>STOU</h3>
<i>Syntax:</i> <samp>STOU</samp>
<p>
Begins transmission of a file to the remote site; the remote filename
will be unique in the current directory. The response from the server
will include the filename.
<p>
<a name=STRU></a>
<h3>STRU</h3>
<i>Syntax:</i> <samp>STRU <i>structure-character</i></samp>
<p>
Sets the file structure for transfer to one of:
<ul>
<li>F - File (no structure)
<li>R - Record structure
<li>P - Page structure
</ul>
The default structure is File.
<p>
<a name=SYST></a>
<h3>SYST</h3>
<i>Syntax:</i> <samp>SYST</samp>
<p>
Returns a word identifying the system, the word "Type:", and the default
transfer type (as would be set by the <a href="rawftp.html#TYPE">TYPE</a> command).
For example: <samp>UNIX Type: L8</samp>
<p>
<a name=TYPE></a>
<h3>TYPE</h3>
<i>Syntax:</i> <samp>TYPE
<i>type-character</i> [<i>second-type-character</i>]</samp>
<p>
Sets the type of file to be transferred. <i>type-character</i> can be any
of:
<ul>
<li>A - ASCII text
<li>E - EBCDIC text
<li>I - image (binary data)
<li>L - local format
</ul>
For A and E, the <i>second-type-character</i> specifies how the text
should be interpreted. It can be:
<ul>
<li>N - Non-print (not destined for printing). This is the default if
<i>second-type-character</i> is omitted.
<li>T - Telnet format control (<samp><CR></samp>,
<samp><FF></samp>, etc.)
<li>C - ASA Carriage Control
</ul>
For L, the <i>second-type-character</i> specifies the number of bits per
byte on the local system, and can not be omitted.
<p>
<a name=USER></a>
<h3>USER</h3>
<i>Syntax:</i> <samp> USER <i>username</i></samp>
<p>
Send this command to begin the login process. <i>username</i> should be a
valid username on the system, or "anonymous" to initiate an anonymous
login.</p>
<p><b>Related:</b></p>
<p> <a href="nt/ftp.html">FTP command</a> - Windows<br>
<a href="bash/ftp.html">FTP command</a> - bash</p></body>
</html>