summaryrefslogtreecommitdiff
path: root/misc/slackbook/html/basic-network-commands-ftp.html
blob: a5b48f073d56199bde44f0898f8723eaf5b13459 (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>FTP Clients</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" />
<link rel="HOME" title="Slackware Linux Essentials" href="index.html" />
<link rel="UP" title="Basic Network Commands" href="basic-network-commands.html" />
<link rel="PREVIOUS" title="Browsers" href="basic-network-commands-web.html" />
<link rel="NEXT" title="Talking to Other People"
href="basic-network-commands-talk.html" />
<link rel="STYLESHEET" type="text/css" href="docbook.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"
alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<th colspan="3" align="center">Slackware Linux Essentials</th>
</tr>

<tr>
<td width="10%" align="left" valign="bottom"><a href="basic-network-commands-web.html"
accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 13 Basic Network Commands</td>
<td width="10%" align="right" valign="bottom"><a href="basic-network-commands-talk.html"
accesskey="N">Next</a></td>
</tr>
</table>

<hr align="LEFT" width="100%" />
</div>

<div class="SECT1">
<h1 class="SECT1"><a id="BASIC-NETWORK-COMMANDS-FTP"
name="BASIC-NETWORK-COMMANDS-FTP">13.9 FTP Clients</a></h1>

<p>FTP stands for the File Transfer Protocol. It allows you to send and receive files
between two computers. There is the FTP server and the FTP client. We discuss the client
in this section.</p>

<p>For the curious, the &#8220;client&#8221; is you. The &#8220;server&#8221; is the
computer that answers your FTP request and lets you login. You will download files from
and upload files to the server. The client cannot accept FTP connections, it can only
connect to servers.</p>

<div class="SECT2">
<h2 class="SECT2"><a id="AEN4871" name="AEN4871">13.9.1 <tt
class="COMMAND">ftp</tt></a></h2>

<p>To connect to an FTP server, simply run the <tt class="COMMAND">ftp</tt>(1) command
and specify the host:</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">%</samp> <kbd class="USERINPUT">ftp &lt;hostname&gt; [port]</kbd>
</pre>
</td>
</tr>
</table>

<p>If the host is running an FTP server, it will ask for a username and password. You can
log in as yourself or as &#8220;anonymous&#8221;. Anonymous FTP sites are very popular
for software archives. For example, to get Slackware Linux via FTP, you must use
anonymous FTP.</p>

<p>Once connected, you will be at the <var class="LITERAL">ftp&gt;</var> prompt. There
are special commands for FTP, but they are similar to other standard commands. The
following shows some of the basic commands and what they do:</p>

<div class="TABLE"><a id="AEN4883" name="AEN4883"></a>
<p><b>Table 13-1. <tt class="COMMAND">ftp</tt> commands</b></p>

<table border="0" frame="void" class="CALSTABLE">
<col width="1*" />
<col width="3*" />
<thead>
<tr>
<th>Command</th>
<th>Purpose</th>
</tr>
</thead>

<tbody>
<tr>
<td><tt class="COMMAND">ls</tt></td>
<td>List files</td>
</tr>

<tr>
<td><tt class="COMMAND">cd &lt;dirname&gt;</tt></td>
<td>Change directory</td>
</tr>

<tr>
<td><tt class="COMMAND">bin</tt></td>
<td>Set binary transfer mode</td>
</tr>

<tr>
<td><tt class="COMMAND">ascii</tt></td>
<td>Set ASCII transfer mode</td>
</tr>

<tr>
<td><tt class="COMMAND">get &lt;filename&gt;</tt></td>
<td>Download a file</td>
</tr>

<tr>
<td><tt class="COMMAND">put &lt;filename&gt;</tt></td>
<td>Upload a file</td>
</tr>

<tr>
<td><tt class="COMMAND">hash</tt></td>
<td>Toggle hash mark stats indicator</td>
</tr>

<tr>
<td><tt class="COMMAND">tick</tt></td>
<td>Toggle byte counter indicator</td>
</tr>

<tr>
<td><tt class="COMMAND">prom</tt></td>
<td>Toggle interactive mode for downloads</td>
</tr>

<tr>
<td><tt class="COMMAND">mget &lt;mask&gt;</tt></td>
<td>Download a file or group of files; wildcards are allowed</td>
</tr>

<tr>
<td><tt class="COMMAND">mput &lt;mask&gt;</tt></td>
<td>Upload a file or group of files; wildcards are allowed</td>
</tr>

<tr>
<td><tt class="COMMAND">quit</tt></td>
<td>Log off the FTP server</td>
</tr>
</tbody>
</table>
</div>

<p>You can also use some of the following commands which are quite self-explanatory: <tt
class="COMMAND">chmod</tt>, <tt class="COMMAND">delete</tt>, <tt
class="COMMAND">rename</tt>, <tt class="COMMAND">rmdir</tt>. For a complete list of all
commands and their meaning, just type <kbd class="USERINPUT">help</kbd> or <kbd
class="USERINPUT">?</kbd> and you'll see a complete listing on screen.</p>

<p>FTP is a fairly simple program to use, but lacks the user interface that many of us
are used to nowadays. The man page discusses some of the command line options for <tt
class="COMMAND">ftp</tt>(1).</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
ftp&#62; <kbd class="USERINPUT">ls *.TXT</kbd>
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
-rw-r--r--   1 root     100         18606 Apr  6  2002 BOOTING.TXT
-rw-r--r--   1 root     100         10518 Jun 13  2002 COPYRIGHT.TXT
-rw-r--r--   1 root     100           602 Apr  6  2002 CRYPTO_NOTICE.TXT
-rw-r--r--   1 root     100         32431 Sep 29 02:56 FAQ.TXT
-rw-r--r--   1 root     100        499784 Mar  3 19:29 FILELIST.TXT
-rw-r--r--   1 root     100        241099 Mar  3 19:12 PACKAGES.TXT
-rw-r--r--   1 root     100         12339 Jun 19  2002 README81.TXT
-rw-r--r--   1 root     100         14826 Jun 17  2002 SPEAKUP_DOCS.TXT
-rw-r--r--   1 root     100         15434 Jun 17  2002 SPEAK_INSTALL.TXT
-rw-r--r--   1 root     100          2876 Jun 17  2002 UPGRADE.TXT
226 Transfer complete.
ftp&#62; <kbd class="USERINPUT">tick</kbd>
Tick counter printing on (10240 bytes/tick increment).
ftp&#62; <kbd class="USERINPUT">get README81.TXT</kbd>
local: README81.TXT remote: README81.TXT
200 PORT command successful.
150 Opening BINARY mode data connection for README81.TXT (12339 bytes).
Bytes transferred: 12339
226 Transfer complete.
12339 bytes received in 0.208 secs (58 Kbytes/sec)
</pre>
</td>
</tr>
</table>
</div>

<div class="SECT2">
<h2 class="SECT2"><a id="BASIC-NETWORK-COMMANDS-FTP-NCFTP"
name="BASIC-NETWORK-COMMANDS-FTP-NCFTP">13.9.2 <tt class="COMMAND">ncftp</tt></a></h2>

<p><tt class="COMMAND">ncftp</tt>(1) (pronounced "Nik-F-T-P") is an alternative to the
traditional ftp client that comes with Slackware. It is still a text-based program, but
offers many advantages over <tt class="COMMAND">ftp</tt>, including:</p>

<ul>
<li>
<p>Tab completion</p>
</li>

<li>
<p>Bookmarks file</p>
</li>

<li>
<p>More liberal wildcard uses</p>
</li>

<li>
<p>Command history</p>
</li>
</ul>

<p>By default, <tt class="COMMAND">ncftp</tt> will try to log in anonymously to the
server you specify. You can force <tt class="COMMAND">ncftp</tt> to present a login
prompt with the &#8220;<var class="OPTION">-u</var>&#8221; option. Once logged in, you
can use the same commands as in <tt class="COMMAND">ftp</tt>, only you'll notice a nicer
interface, one that works more like <tt class="COMMAND">bash</tt>.</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
ncftp /pub/linux/slackware &#62; <kbd class="USERINPUT">cd slackware-current/</kbd>
Please read the file README81.TXT
  it was last modified on Wed Jun 19 16:24:21 2002 - 258 days ago
CWD command successful.
ncftp ...ware/slackware-current &#62; <kbd class="USERINPUT">ls</kbd>
BOOTING.TXT               FAQ.TXT                   bootdisks/
CHECKSUMS                 FILELIST.TXT              extra/
CHECKSUMS.asc             GPG-KEY                   isolinux/
CHECKSUMS.md5             PACKAGES.TXT              kernels/
CHECKSUMS.md5.asc         PRERELEASE_NOTES          pasture/
COPYING                   README81.TXT              rootdisks/
COPYRIGHT.TXT             SPEEKUP_DOCS.TXT          slackware/
CRYPTO_NOTICE.TXT         SPEEK_INSTALL.TXT         source/
CURRENT.WARNING           Slackware-HOWTO
ChangeLog.txt             UPGRADE.TXT
ncftp ...ware/slackware-current &#62; <kbd class="USERINPUT">get README81.TXT</kbd>
README81.TXT:                                           12.29 kB  307.07 kB/s
</pre>
</td>
</tr>
</table>
</div>
</div>

<div class="NAVFOOTER">
<hr align="LEFT" width="100%" />
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="basic-network-commands-web.html"
accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html"
accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="basic-network-commands-talk.html"
accesskey="N">Next</a></td>
</tr>

<tr>
<td width="33%" align="left" valign="top">Browsers</td>
<td width="34%" align="center" valign="top"><a href="basic-network-commands.html"
accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Talking to Other People</td>
</tr>
</table>
</div>
</body>
</html>