first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[ira/wip.git] / docs / htmldocs / smbclient.1.html
1
2
3  
4
5
6 <html><head><title>smbclient (1)</title>
7
8 <link rev="made" href="mailto:samba-bugs@samba.org">
9 </head>
10 <body>
11
12 <hr>
13
14 <h1>smbclient (1)</h1>
15 <h2>Samba</h2>
16 <h2>23 Oct 1998</h2>
17
18     
19
20     
21 <p><br><a name="NAME"></a>
22 <h2>NAME</h2>
23     smbclient - ftp-like client to access SMB/CIFS resources on servers
24 <p><br><a name="SYNOPSIS"></a>
25 <h2>SYNOPSIS</h2>
26     
27 <p><br><strong>smbclient</strong> <a href="smbclient.1.html#servicename">servicename</a> [<a href="smbclient.1.html#minuss">-s smb.conf</a>] [<a href="smbclient.1.html#minusO">-O socket options</a>][<a href="smbclient.1.html#minusR">-R name resolve order</a>] [<a href="smbclient.1.html#minusM">-M NetBIOS name</a>] [<a href="smbclient.1.html#minusi">-i scope</a>] [<a href="smbclient.1.html#minusN">-N</a>] [<a href="smbclient.1.html#minusn">-n NetBIOS name</a>] [<a href="smbclient.1.html#minusd">-d debuglevel</a>] [<a href="smbclient.1.html#minusP">-P</a>] [<a href="smbclient.1.html#minusp">-p port</a>] [<a href="smbclient.1.html#minusl">-l log basename</a>] [<a href="smbclient.1.html#minush">-h</a>] [<a href="smbclient.1.html#minusI">-I dest IP</a>] [<a href="smbclient.1.html#minusE">-E</a>] [<a href="smbclient.1.html#minusU">-U username</a>] [<a href="smbclient.1.html#minusL">-L NetBIOS name</a>] [<a href="smbclient.1.html#minust">-t terminal code</a>] [<a href="smbclient.1.html#minusm">-m max protocol</a>] [<a href="smbclient.1.html#minusb">-b buffersize</a>] [<a href="smbclient.1.html#minusW">-W workgroup</a>] [<a href="smbclient.1.html#minusT">-T&lt;c|x&gt;IXFqgbNan</a>] [<a href="smbclient.1.html#minusD">-D directory</a>] [<a href="smbclient.1.html#minusc">-c command string</a>]
28 <p><br><a name="DESCRIPTION"></a>
29 <h2>DESCRIPTION</h2>
30     
31 <p><br>This program is part of the <strong>Samba</strong> suite.
32 <p><br><strong>smbclient</strong> is a client that can 'talk' to an SMB/CIFS server. It
33 offers an interface similar to that of the ftp program (see <strong>ftp
34 (1)</strong>).  Operations include things like getting files from the server
35 to the local machine, putting files from the local machine to the
36 server, retrieving directory information from the server and so on.
37 <p><br><a name="OPTIONS"></a>
38 <h2>OPTIONS</h2>
39     
40 <p><br><ul>
41 <p><br><a name="servicename"></a>
42 <li><strong><strong>servicename</strong></strong> servicename is the name of the service you want
43 to use on the server. A service name takes the form
44 <code>//server/service</code> where <em>server</em> is the NetBIOS name of the SMB/CIFS
45 server offering the desired service and <em>service</em> is the name
46 of the service offered. Thus to connect to the service <em>printer</em> on
47 the SMB/CIFS server <em>smbserver</em>, you would use the servicename
48 <p><br><code>//smbserver/printer</code>
49 <p><br>Note that the server name required is NOT necessarily the IP (DNS)
50 host name of the server ! The name required is a NetBIOS server name,
51 which may or may not be the same as the IP hostname of the machine
52 running the server.
53 <p><br>The server name is looked up according to either the
54 <a href="smbclient.1.html#minusR"><strong>-R</strong></a> parameter to <strong>smbclient</strong> or using the
55 <a href="smb.conf.5.html#nameresolveorder"><strong>name resolve order</strong></a>
56 parameter in the smb.conf file, allowing an administrator to change
57 the order and methods by which server names are looked up.
58 <p><br><a name="password"></a>
59 <li><strong><strong>password</strong></strong> password is the password required to access the
60 specified service on the specified server. If this parameter is
61 supplied, the <a href="smbclient.1.html#minusN"><strong>-N</strong></a> option (suppress password prompt) is assumed.
62 <p><br>There is no default password. If no password is supplied on the
63 command line (either by using this parameter or adding a password to
64 the <a href="smbclient.1.html#minusU"><strong>-U</strong></a> option (see below)) and the <a href="smbclient.1.html#minusN"><strong>-N</strong></a> option is not specified,
65 the client will prompt for a password, even if the desired service
66 does not require one. (If no password is required, simply press ENTER
67 to provide a null password.)
68 <p><br>Note: Some servers (including OS/2 and Windows for Workgroups) insist
69 on an uppercase password. Lowercase or mixed case passwords may be
70 rejected by these servers.
71 <p><br>Be cautious about including passwords in scripts.
72 <p><br><a name="minuss"></a>
73 <li><strong><strong>-s smb.conf</strong></strong> This parameter specifies the pathname to the
74 Samba configuration file, smb.conf. This file controls all aspects of
75 the Samba setup on the machine and smbclient also needs to read this
76 file.
77 <p><br><a name="minusO"></a>
78 <li><strong><strong>-O socket options</strong></strong> TCP socket options to set on the client
79 socket. See the <a href="smb.conf.5.html#socketoptions">socket options</a>
80 parameter in the <a href="smb.conf.5.html"><strong>smb.conf (5)</strong></a> manpage for
81 the list of valid options.
82 <p><br><a name="minusR"></a>
83 <li><strong><strong>-R name resolve order</strong></strong> This option allows the user of
84 smbclient to determine what name resolution services to use when
85 looking up the NetBIOS name of the host being connected to.
86 <p><br>The options are :"lmhosts", "host", "wins" and "bcast". They cause
87 names to be resolved as follows :
88 <p><br><ul>
89 <p><br><li > <strong>lmhosts</strong> : Lookup an IP address in the Samba lmhosts file.
90 The lmhosts file is stored in the same directory as the
91 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file.
92 <p><br><li > <strong>host</strong> : Do a standard host name to IP address resolution,
93 using the system /etc/hosts, NIS, or DNS lookups. This method of name
94 resolution is operating system depended for instance on IRIX or
95 Solaris this may be controlled by the <em>/etc/nsswitch.conf</em> file).  
96 <p><br><li > <strong>wins</strong> : Query a name with the IP address listed in the <a href="smb.conf.5.html#winsserver"><strong>wins
97 server</strong></a> parameter in the smb.conf file. If 
98 no WINS server has been specified this method will be ignored.
99 <p><br><li > <strong>bcast</strong> : Do a broadcast on each of the known local interfaces
100 listed in the <a href="smb.conf.5.html#interfaces"><strong>interfaces</strong></a> parameter
101 in the smb.conf file. This is the least reliable of the name resolution
102 methods as it depends on the target host being on a locally connected
103 subnet. 
104 <p><br></ul>
105 <p><br>If this parameter is not set then the name resolve order defined
106 in the <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file parameter 
107 <a href="smb.conf.5.html#nameresolveorder">(<strong>name resolve order</strong>)</a>
108 will be used.
109 <p><br>The default order is lmhosts, host, wins, bcast and without this
110 parameter or any entry in the <a href="smb.conf.5.html#nameresolveorder"><strong>"name resolve
111 order"</strong></a> parameter of the
112 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file the name resolution methods
113 will be attempted in this order.
114 <p><br><a name="minusM"></a>
115 <li><strong><strong>-M NetBIOS name</strong></strong> This options allows you to send messages,
116 using the "WinPopup" protocol, to another computer. Once a connection
117 is established you then type your message, pressing ^D (control-D) to
118 end.
119 <p><br>If the receiving computer is running WinPopup the user will receive
120 the message and probably a beep. If they are not running WinPopup the
121 message will be lost, and no error message will occur.
122 <p><br>The message is also automatically truncated if the message is over
123 1600 bytes, as this is the limit of the protocol.
124 <p><br>One useful trick is to cat the message through <strong>smbclient</strong>.
125 For example:
126 <p><br><code>cat mymessage.txt | smbclient -M FRED</code>
127 <p><br>will send the message in the file <em>mymessage.txt</em> to the machine FRED.
128 <p><br>You may also find the <a href="smbclient.1.html#minusU"><strong>-U</strong></a> and <a href="smbclient.1.html#minusI"><strong>-I</strong></a> options useful, as they allow
129 you to control the FROM and TO parts of the message.
130 <p><br>See the <a href="smb.conf.5.html#messagecommand"><strong>message command</strong></a>
131 parameter in the <strong>smb.conf (5)</strong> for a description of how to handle
132 incoming WinPopup messages in Samba.
133 <p><br>Note: Copy WinPopup into the startup group on your WfWg PCs if you
134 want them to always be able to receive messages.
135 <p><br><a name="minusi"></a>
136 <li><strong><strong>-i scope</strong></strong> This specifies a NetBIOS scope that smbclient will use
137 to communicate with when generating NetBIOS names. For details on the
138 use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes
139 are <em>very</em> rarely used, only set this parameter if you are the
140 system administrator in charge of all the NetBIOS systems you
141 communicate with.
142 <p><br><a name="minusN"></a>
143 <li><strong><strong>-N</strong></strong> If specified, this parameter suppresses the normal
144 password prompt from the client to the user. This is useful when
145 accessing a service that does not require a password.
146 <p><br>Unless a password is specified on the command line or this parameter
147 is specified, the client will request a password.
148 <p><br><a name="minusn"></a>
149 <li><strong><strong>-n NetBIOS name</strong></strong> By default, the client will use the local
150 machine's hostname (in uppercase) as its NetBIOS name. This parameter
151 allows you to override the host name and use whatever NetBIOS name you
152 wish.
153 <p><br><a name="minusd"></a>
154 <li><strong><strong>-d debuglevel</strong></strong> debuglevel is an integer from 0 to 10, or the
155 letter 'A'.
156 <p><br>The default value if this parameter is not specified is zero.
157 <p><br>The higher this value, the more detail will be logged to the log files
158 about the activities of the client. At level 0, only critical errors
159 and serious warnings will be logged. Level 1 is a reasonable level for
160 day to day running - it generates a small amount of information about
161 operations carried out.
162 <p><br>Levels above 1 will generate considerable amounts of log data, and
163 should only be used when investigating a problem. Levels above 3 are
164 designed for use only by developers and generate HUGE amounts of log
165 data, most of which is extremely cryptic. If debuglevel is set to the
166 letter 'A', then <em>all</em> debug messages will be printed. This setting
167 is for developers only (and people who <em>really</em> want to know how the
168 code works internally).
169 <p><br>Note that specifying this parameter here will override the <a href="smb.conf.5.html#loglevel"><strong>log
170 level</strong></a> parameter in the <a href="smb.conf.5.html"><strong>smb.conf
171 (5)</strong></a> file.
172 <p><br><a name="minusP"></a>
173 <li><strong><strong>-P</strong></strong> This option is no longer used. The code in Samba2.0
174 now lets the server decide the device type, so no printer specific
175 flag is needed.
176 <p><br><a name="minusp"></a>
177 <li><strong><strong>-p port</strong></strong> This number is the TCP port number that will be used
178 when making connections to the server. The standard (well-known) TCP
179 port number for an SMB/CIFS server is 139, which is the default.
180 <p><br><a name="minusl"></a>
181 <li><strong><strong>-l logfilename</strong></strong> If specified, logfilename specifies a base
182 filename into which operational data from the running client will be
183 logged.
184 <p><br>The default base name is specified at compile time.
185 <p><br>The base name is used to generate actual log file names. For example,
186 if the name specified was "log", the debug file would be
187 <code>log.client</code>.
188 <p><br>The log file generated is never removed by the client.
189 <p><br><a name="minush"></a>
190 <li><strong><strong>-h</strong></strong> Print the usage message for the client.
191 <p><br><a name="minusI"></a>
192 <li><strong><strong>-I IP address</strong></strong> IP address is the address of the server to
193 connect to. It should be specified in standard "a.b.c.d" notation.
194 <p><br>Normally the client would attempt to locate a named SMB/CIFS server by
195 looking it up via the NetBIOS name resolution mechanism described
196 above in the <a href="smbclient.1.html#minusR"><strong>name resolve order</strong></a> parameter
197 above. Using this parameter will force the client to assume that the
198 server is on the machine with the specified IP address and the NetBIOS
199 name component of the resource being connected to will be ignored.
200 <p><br>There is no default for this parameter. If not supplied, it will be
201 determined automatically by the client as described above.
202 <p><br><a name="minusE"></a>
203 <li><strong><strong>-E</strong></strong> This parameter causes the client to write messages to the
204 standard error stream (stderr) rather than to the standard output
205 stream.
206 <p><br>By default, the client writes messages to standard output - typically
207 the user's tty.
208 <p><br><a name="minusU"></a>
209 <li><strong><strong>-U username</strong></strong> This specifies the user name that will be used by
210 the client to make a connection, assuming your server is not a downlevel
211 server that is running a protocol level that uses passwords on shares,
212 not on usernames.
213 <p><br>Some servers are fussy about the case of this name, and some insist
214 that it must be a valid NetBIOS name.
215 <p><br>If no username is supplied, it will default to an uppercase version of
216 the environment variable <code>USER</code> or <code>LOGNAME</code> in that order.  If no
217 username is supplied and neither environment variable exists the
218 username "GUEST" will be used.
219 <p><br>If the <code>USER</code> environment variable contains a '%' character,
220 everything after that will be treated as a password. This allows you
221 to set the environment variable to be <code>USER=username%password</code> so
222 that a password is not passed on the command line (where it may be
223 seen by the ps command).
224 <p><br>If the service you are connecting to requires a password, it can be
225 supplied using the <a href="smbclient.1.html#minusU"><strong>-U</strong></a> option, by appending a percent symbol ("%")
226 then the password to username.  For example, to attach to a service as
227 user <code>"fred"</code> with password <code>"secret"</code>, you would specify. <br>
228 <p><br><code>-U fred%secret</code> <br>
229 <p><br>on the command line. Note that there are no spaces around the percent
230 symbol.
231 <p><br>If you specify the password as part of username then the <a href="smbclient.1.html#minusN"><strong>-N</strong></a> option
232 (suppress password prompt) is assumed.
233 <p><br>If you specify the password as a parameter <em>AND</em> as part of username
234 then the password as part of username will take precedence. Putting
235 nothing before or nothing after the percent symbol will cause an empty
236 username or an empty password to be used, respectively.
237 <p><br>The password may also be specified by setting up an environment
238 variable called <code>PASSWD</code> that contains the users password. Note
239 that this may be very insecure on some systems but on others allows
240 users to script smbclient commands without having a password appear in
241 the command line of a process listing.
242 <p><br>Note: Some servers (including OS/2 and Windows for Workgroups) insist
243 on an uppercase password. Lowercase or mixed case passwords may be
244 rejected by these servers.
245 <p><br>Be cautious about including passwords in scripts or in the
246 <code>PASSWD</code> environment variable. Also, on many systems the command
247 line of a running process may be seen via the <code>ps</code> command to be
248 safe always allow smbclient to prompt for a password and type it in
249 directly.
250 <p><br><a name="minusL"></a>
251 <li><strong><strong>-L</strong></strong> This option allows you to look at what services are
252 available on a server. You use it as <code>"smbclient -L host"</code> and a
253 list should appear.  The <a href="smbclient.1.html#minusI"><strong>-I</strong></a> option may be useful if your NetBIOS
254 names don't match your tcp/ip dns host names or if you are trying to
255 reach a host on another network.
256 <p><br><a name="minust"></a>
257 <li><strong><strong>-t terminal code</strong></strong> This option tells smbclient how to interpret
258 filenames coming from the remote server. Usually Asian language
259 multibyte UNIX implementations use different character sets than
260 SMB/CIFS servers (<em>EUC</em> instead of <em>SJIS</em> for example). Setting
261 this parameter will let smbclient convert between the UNIX filenames
262 and the SMB filenames correctly. This option has not been seriously
263 tested and may have some problems.
264 <p><br>The terminal codes include <code>sjis</code>, <code>euc</code>, <code>jis7</code>, <code>jis8</code>,
265 <code>junet</code>, <code>hex</code>, <code>cap</code>. This is not a complete list, check the
266 Samba source code for the complete list.
267 <p><br><a name="minusm"></a>
268 <li><strong><strong>-m max protocol level</strong></strong> With the new code in Samba2.0,
269 <strong>smbclient</strong> always attempts to connect at the maximum
270 protocols level the server supports. This parameter is
271 preserved for backwards compatibility, but any string
272 following the <strong>-m</strong> will be ignored.
273 <p><br><a name="minusb"></a>
274 <li><strong><strong>-b buffersize</strong></strong> This option changes the transmit/send buffer
275 size when getting or putting a file from/to the server. The default
276 is 65520 bytes. Setting this value smaller (to 1200 bytes) has been
277 observed to speed up file transfers to and from a Win9x server.
278 <p><br><a name="minusW"></a>
279 <li><strong><strong>-W WORKGROUP</strong></strong> Override the default workgroup specified in the
280 <a href="smb.conf.5.html#workgroup"><strong>workgroup</strong></a> parameter of the
281 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file for this connection. This may
282 be needed to connect to some servers.
283 <p><br><a name="minusT"></a> <li><strong><strong>-T tar options</strong></strong> smbclient may be used to create
284 <strong>tar (1)</strong> compatible backups of all the files on an SMB/CIFS
285 share. The secondary tar flags that can be given to this option are :
286 <p><br><ul>
287 <p><br><li><strong><strong>c</strong></strong> Create a tar file on UNIX. Must be followed by the
288         name of a tar file, tape device or <code>"-"</code> for standard output. If
289         using standard output you must turn the log level to its lowest value
290     <code>-d0</code> to avoid corrupting your tar file. This flag is
291         mutually exclusive with the <strong>x</strong> flag.
292 <p><br><li><strong><strong>x</strong></strong> Extract (restore) a local tar file back to a
293         share. Unless the <a href="smbclient.1.html#minusD"><strong>-D</strong></a> option is given, the tar files will be
294         restored from the top level of the share. Must be followed by the name
295         of the tar file, device or <code>"-"</code> for standard input. Mutually exclusive
296         with the <strong>c</strong> flag. Restored files have their creation times (mtime)
297         set to the date saved in the tar file. Directories currently do not
298         get their creation dates restored properly.
299 <p><br><li><strong><strong>I</strong></strong> Include files and directories. Is the default
300         behavior when filenames are specified above. Causes tar files to
301         be included in an extract or create (and therefore everything else to
302         be excluded). See example below.  Filename globbing works 
303         in one of two ways.  See <strong>r</strong> below.
304 <p><br><li><strong><strong>X</strong></strong> Exclude files and directories. Causes tar files to
305         be excluded from an extract or create. See example below.  Filename
306         globbing works in one of two ways now. See <strong>r</strong> below.
307 <p><br><li><strong><strong>b</strong></strong> Blocksize. Must be followed by a valid (greater than
308         zero) blocksize.  Causes tar file to be written out in
309         blocksize*TBLOCK (usually 512 byte) blocks.
310 <p><br><li><strong><strong>g</strong></strong> Incremental. Only back up files that have the
311         archive bit set. Useful only with the <strong>c</strong> flag.
312 <p><br><li><strong><strong>q</strong></strong> Quiet. Keeps tar from printing diagnostics as it
313         works.  This is the same as tarmode quiet.
314 <p><br><li><strong><strong>r</strong></strong> Regular expression include or exclude.  Uses regular 
315         regular expression matching for excluding or excluding files if 
316         compiled with HAVE_REGEX_H. However this mode can be very slow. If 
317         not compiled with HAVE_REGEX_H, does a limited wildcard match on * and 
318         ?.
319 <p><br><li><strong><strong>N</strong></strong> Newer than. Must be followed by the name of a file
320         whose date is compared against files found on the share during a
321         create. Only files newer than the file specified are backed up to the
322         tar file. Useful only with the <strong>c</strong> flag.
323 <p><br><li><strong><strong>a</strong></strong> Set archive bit. Causes the archive bit to be reset
324         when a file is backed up. Useful with the <strong>g</strong> and <strong>c</strong> flags.
325 <p><br></ul>
326 <p><br><em>Tar Long File Names</em>
327 <p><br>smbclient's tar option now supports long file names both on backup and
328 restore. However, the full path name of the file must be less than
329 1024 bytes.  Also, when a tar archive is created, smbclient's tar
330 option places all files in the archive with relative names, not
331 absolute names.
332 <p><br><em>Tar Filenames</em>
333 <p><br>All file names can be given as DOS path names (with <code>\</code> as the
334 component separator) or as UNIX path names (with <code>/</code> as the
335 component separator).
336 <p><br><em>Examples</em>
337 <p><br><ul>
338 <p><br><li > Restore from tar file backup.tar into myshare on mypc (no password on share).
339 <p><br><code>smbclient //mypc/myshare "" -N -Tx backup.tar</code>
340 <p><br><li > Restore everything except users/docs
341 <p><br><code>smbclient //mypc/myshare "" -N -TXx backup.tar users/docs</code>
342 <p><br><li > Create a tar file of the files beneath users/docs.
343 <p><br><code>smbclient //mypc/myshare "" -N -Tc backup.tar users/docs</code>
344 <p><br><li > Create the same tar file as above, but now use a DOS path name.
345 <p><br><code>smbclient //mypc/myshare "" -N -tc backup.tar users\edocs</code>
346 <p><br><li > Create a tar file of all the files and directories in the share.
347 <p><br><code>smbclient //mypc/myshare "" -N -Tc backup.tar *</code>
348 <p><br></ul>
349 <p><br><a name="minusD"></a>
350 <li><strong><strong>-D initial directory</strong></strong> Change to initial directory before
351 starting. Probably only of any use with the tar <a href="smbclient.1.html#minusT"><strong>-T</strong></a> option.
352 <p><br><a name="minusc"></a>
353 <li><strong><strong>-c command string</strong></strong> command string is a semicolon separated
354 list of commands to be executed instead of prompting from stdin.
355 <a href="smbclient.1.html#minusN"><strong>-N</strong></a> is implied by <strong>-c</strong>.
356 <p><br>This is particularly useful in scripts and for printing stdin to the
357 server, e.g. <code>-c 'print -'</code>.
358 <p><br></ul>
359 <p><br><a name="OPERATIONS"></a>
360 <h2>OPERATIONS</h2>
361     
362 <p><br>Once the client is running, the user is presented with a prompt :
363 <p><br><code>smb:\&gt;</code>
364 <p><br>The backslash ("\") indicates the current working directory on the
365 server, and will change if the current working directory is changed.
366 <p><br>The prompt indicates that the client is ready and waiting to carry out
367 a user command. Each command is a single word, optionally followed by
368 parameters specific to that command. Command and parameters are
369 space-delimited unless these notes specifically state otherwise. All
370 commands are case-insensitive.  Parameters to commands may or may not
371 be case sensitive, depending on the command.
372 <p><br>You can specify file names which have spaces in them by quoting the
373 name with double quotes, for example "a long file name".
374 <p><br>Parameters shown in square brackets (e.g., "[parameter]") are
375 optional. If not given, the command will use suitable
376 defaults. Parameters shown in angle brackets (e.g., "&lt;parameter&gt;") are
377 required.
378 <p><br>Note that all commands operating on the server are actually performed
379 by issuing a request to the server. Thus the behavior may vary from
380 server to server, depending on how the server was implemented.
381 <p><br>The commands available are given here in alphabetical order.
382 <p><br><ul>
383 <p><br><a name="questionmark"></a> <li><strong><strong>? [command]</strong></strong> If "command" is specified,
384 the <strong>?</strong> command will display a brief informative message about the
385 specified command.  If no command is specified, a list of available
386 commands will be displayed.
387 <p><br><a name="exclaimationmark"></a> <li><strong><strong>! [shell command]</strong></strong> If "shell command"
388 is specified, the <strong>!</strong>  command will execute a shell locally and run
389 the specified shell command. If no command is specified, a local shell
390 will be run.
391 <p><br><a name="cd"></a> <li><strong><strong>cd [directory name]</strong></strong> If "directory name" is
392 specified, the current working directory on the server will be changed
393 to the directory specified. This operation will fail if for any reason
394 the specified directory is inaccessible.
395 <p><br>If no directory name is specified, the current working directory on
396 the server will be reported.
397 <p><br><a name="del"></a> <li><strong><strong>del &lt;mask&gt;</strong></strong> The client will request that the server
398 attempt to delete all files matching "mask" from the current working
399 directory on the server.
400 <p><br><a name="dir"></a> <li><strong><strong>dir &lt;mask&gt;</strong></strong> A list of the files matching "mask" in
401 the current working directory on the server will be retrieved from the
402 server and displayed.
403 <p><br><a name="exit"></a> <li><strong><strong>exit</strong></strong> Terminate the connection with the server and
404 exit from the program.
405 <p><br><a name="get"></a> <li><strong><strong>get &lt;remote file name&gt; [local file name]</strong></strong> Copy the
406 file called "remote file name" from the server to the machine running
407 the client. If specified, name the local copy "local file name".  Note
408 that all transfers in smbclient are binary. See also the
409 <a href="smbclient.1.html#lowercase"><strong>lowercase</strong></a> command.
410 <p><br><a name="help"></a> <li><strong><strong>help [command]</strong></strong> See the <a href="smbclient.1.html#questionmark"><strong>?</strong></a>
411 command above.
412 <p><br><a name="lcd"></a> <li><strong><strong>lcd [directory name]</strong></strong> If "directory name" is
413 specified, the current working directory on the local machine will
414 be changed to the directory specified. This operation will fail if for
415 any reason the specified directory is inaccessible.
416 <p><br>If no directory name is specified, the name of the current working
417 directory on the local machine will be reported.
418 <p><br><a name="lowercase"></a> <li><strong><strong>lowercase</strong></strong> Toggle lowercasing of filenames
419 for the <a href="smbclient.1.html#get"><strong>get</strong></a> and <a href="smbclient.1.html#mget"><strong>mget</strong></a> commands.
420 <p><br>When lowercasing is toggled ON, local filenames are converted to
421 lowercase when using the <a href="smbclient.1.html#get"><strong>get</strong></a> and <a href="smbclient.1.html#mget"><strong>mget</strong></a>
422 commands. This is often useful when copying (say) MSDOS files from a
423 server, because lowercase filenames are the norm on UNIX systems.
424 <p><br><a name="ls"></a> <li><strong><strong>ls &lt;mask&gt;</strong></strong> See the <a href="smbclient.1.html#dir"><strong>dir</strong></a> command above.
425 <p><br><a name="mask"></a> <li><strong><strong>mask &lt;mask&gt;</strong></strong> This command allows the user to set
426 up a mask which will be used during recursive operation of the
427 <a href="smbclient.1.html#mget"><strong>mget</strong></a> and <a href="smbclient.1.html#mput"><strong>mput</strong></a> commands.
428 <p><br>The masks specified to the <a href="smbclient.1.html#mget"><strong>mget</strong></a> and
429 <a href="smbclient.1.html#mput"><strong>mput</strong></a> commands act as filters for directories rather
430 than files when recursion is toggled ON.
431 <p><br>The mask specified with the .B mask command is necessary to filter
432 files within those directories. For example, if the mask specified in
433 an <a href="smbclient.1.html#mget"><strong>mget</strong></a> command is "source*" and the mask specified
434 with the mask command is "*.c" and recursion is toggled ON, the
435 <a href="smbclient.1.html#mget"><strong>mget</strong></a> command will retrieve all files matching "*.c" in
436 all directories below and including all directories matching "source*"
437 in the current working directory.
438 <p><br>Note that the value for mask defaults to blank (equivalent to "*") and
439 remains so until the mask command is used to change it. It retains the
440 most recently specified value indefinitely. To avoid unexpected
441 results it would be wise to change the value of .I mask back to "*"
442 after using the <a href="smbclient.1.html#mget"><strong>mget</strong></a> or <a href="smbclient.1.html#mput"><strong>mput</strong></a> commands.
443 <p><br><a name="md"></a> <li><strong><strong>md &lt;directory name&gt;</strong></strong> See the <a href="smbclient.1.html#mkdir"><strong>mkdir</strong></a>
444 command.
445 <p><br><a name="mget"></a> <li><strong><strong>mget &lt;mask&gt;</strong></strong> Copy all files matching mask from the
446 server to the machine running the client.
447 <p><br>Note that mask is interpreted differently during recursive operation
448 and non-recursive operation - refer to the <a href="smbclient.1.html#recurse"><strong>recurse</strong></a>
449 and <a href="smbclient.1.html#mask"><strong>mask</strong></a> commands for more information. Note that all
450 transfers in .B smbclient are binary. See also the
451 <a href="smbclient.1.html#lowercase"><strong>lowercase</strong></a> command.
452 <p><br><a name="mkdir"></a> <li><strong><strong>mkdir &lt;directory name&gt;</strong></strong> Create a new directory on
453 the server (user access privileges permitting) with the specified
454 name.
455 <p><br><a name="mput"></a> <li><strong><strong>mput &lt;mask&gt;</strong></strong> Copy all files matching mask in
456 the current working directory on the local machine to the current
457 working directory on the server.
458 <p><br>Note that mask is interpreted differently during recursive operation
459 and non-recursive operation - refer to the <a href="smbclient.1.html#recurse"><strong>recurse</strong></a>
460 and <a href="smbclient.1.html#mask"><strong>mask</strong></a> commands for more information. Note that all
461 transfers in .B smbclient are binary.
462 <p><br><a name="print"></a> <li><strong><strong>print &lt;file name&gt;</strong></strong> Print the specified file
463 from the local machine through a printable service on the server.
464 <p><br>See also the <a href="smbclient.1.html#printmode"><strong>printmode</strong></a> command.
465 <p><br><a name="printmode"></a> <li><strong><strong>printmode &lt;graphics or text&gt;</strong></strong> Set the print
466 mode to suit either binary data (such as graphical information) or
467 text. Subsequent print commands will use the currently set print
468 mode.
469 <p><br><a name="prompt"></a> <li><strong><strong>prompt</strong></strong> Toggle prompting for filenames during
470 operation of the <a href="smbclient.1.html#mget"><strong>mget</strong></a> and <a href="smbclient.1.html#mput"><strong>mput</strong></a>
471 commands.
472 <p><br>When toggled ON, the user will be prompted to confirm the transfer of
473 each file during these commands. When toggled OFF, all specified files
474 will be transferred without prompting.
475 <p><br><a name="put"></a> <li><strong><strong>put &lt;local file name&gt; [remote file name]</strong></strong> Copy the
476 file called "local file name" from the machine running the client to
477 the server. If specified, name the remote copy "remote file name".
478 Note that all transfers in smbclient are binary. See also the
479 <a href="smbclient.1.html#lowercase"><strong>lowercase</strong></a> command.
480 <p><br><a name="queue"></a> <li><strong><strong>queue</strong></strong> Displays the print queue, showing the job
481 id, name, size and current status.
482 <p><br><a name="quit"></a> <li><strong><strong>quit</strong></strong> See the <a href="smbclient.1.html#exit"><strong>exit</strong></a> command.
483 <p><br><a name="rd"></a> <li><strong><strong>rd &lt;directory name&gt;</strong></strong> See the <a href="smbclient.1.html#rmdir"><strong>rmdir</strong></a>
484 command.
485 <p><br><a name="recurse"></a> <li><strong><strong>recurse</strong></strong> Toggle directory recursion for the
486 commands <a href="smbclient.1.html#mget"><strong>mget</strong></a> and <a href="smbclient.1.html#mput"><strong>mput</strong></a>.
487 <p><br>When toggled ON, these commands will process all directories in the
488 source directory (i.e., the directory they are copying .IR from ) and
489 will recurse into any that match the mask specified to the
490 command. Only files that match the mask specified using the
491 <a href="smbclient.1.html#mask"><strong>mask</strong></a> command will be retrieved. See also the
492 <a href="smbclient.1.html#mask"><strong>mask</strong></a> command.
493 <p><br>When recursion is toggled OFF, only files from the current working
494 directory on the source machine that match the mask specified to the
495 <a href="smbclient.1.html#mget"><strong>mget</strong></a> or <a href="smbclient.1.html#mput"><strong>mput</strong></a> commands will be copied,
496 and any mask specified using the <a href="smbclient.1.html#mask"><strong>mask</strong></a> command will be
497 ignored.
498 <p><br><a name="rm"></a> <li><strong><strong>rm &lt;mask&gt;</strong></strong> Remove all files matching mask from
499 the current working directory on the server.
500 <p><br><a name="rmdir"></a> <li><strong><strong>rmdir &lt;directory name&gt;</strong></strong> Remove the specified
501 directory (user access privileges permitting) from the server.
502 <p><br><a name="tar"></a> <li><strong><strong>tar &lt;c|x&gt;[IXbgNa]</strong></strong> Performs a tar operation - see
503 the <a href="smbclient.1.html#minusT"><strong>-T</strong></a> command line option above. Behavior may be
504 affected by the <a href="smbclient.1.html#tarmode"><strong>tarmode</strong></a> command (see below). Using
505 g (incremental) and N (newer) will affect tarmode settings. Note that
506 using the "-" option with tar x may not work - use the command line
507 option instead.
508 <p><br><a name="blocksize"></a> <li><strong><strong>blocksize &lt;blocksize&gt;</strong></strong> Blocksize. Must be
509 followed by a valid (greater than zero) blocksize. Causes tar file to
510 be written out in blocksize*TBLOCK (usually 512 byte) blocks.
511 <p><br><a name="tarmode"></a> <li><strong><strong>tarmode &lt;full|inc|reset|noreset&gt;</strong></strong> Changes tar's
512 behavior with regard to archive bits. In full mode, tar will back up
513 everything regardless of the archive bit setting (this is the default
514 mode). In incremental mode, tar will only back up files with the
515 archive bit set. In reset mode, tar will reset the archive bit on all
516 files it backs up (implies read/write share).
517 <p><br><a name="setmode"></a> <li><strong><strong>setmode &lt;filename&gt; &lt;perm=[+|\-]rsha&gt;</strong></strong> A version
518 of the DOS attrib command to set file permissions. For example:
519 <p><br><code>setmode myfile +r</code>
520 <p><br>would make myfile read only.
521 <p><br></ul>
522 <p><br><a name="NOTES"></a>
523 <h2>NOTES</h2>
524     
525 <p><br>Some servers are fussy about the case of supplied usernames,
526 passwords, share names (AKA service names) and machine names. If you
527 fail to connect try giving all parameters in uppercase.
528 <p><br>It is often necessary to use the <a href="smbclient.1.html#minusn"><strong>-n</strong></a> option when connecting to some
529 types of servers. For example OS/2 LanManager insists on a valid
530 NetBIOS name being used, so you need to supply a valid name that would
531 be known to the server.
532 <p><br>smbclient supports long file names where the server supports the
533 LANMAN2 protocol or above.
534 <p><br><a name="ENVIRONMENTVARIABLES"></a>
535 <h2>ENVIRONMENT VARIABLES</h2>
536     
537 <p><br>The variable <strong>USER</strong> may contain the username of the person using the
538 client.  This information is used only if the protocol level is high
539 enough to support session-level passwords.
540 <p><br>The variable <strong>PASSWD</strong> may contain the password of the person using
541 the client.  This information is used only if the protocol level is
542 high enough to support session-level passwords.
543 <p><br><a name="INSTALLATION"></a>
544 <h2>INSTALLATION</h2>
545     
546 <p><br>The location of the client program is a matter for individual system
547 administrators. The following are thus suggestions only.
548 <p><br>It is recommended that the smbclient software be installed in the
549 /usr/local/samba/bin or /usr/samba/bin directory, this directory
550 readable by all, writeable only by root. The client program itself
551 should be executable by all. The client should <em>NOT</em> be setuid or
552 setgid!
553 <p><br>The client log files should be put in a directory readable and
554 writeable only by the user.
555 <p><br>To test the client, you will need to know the name of a running
556 SMB/CIFS server. It is possible to run <a href="smbd.8.html"><strong>smbd (8)</strong></a>
557 an ordinary user - running that server as a daemon on a
558 user-accessible port (typically any port number over 1024) would
559 provide a suitable test server.
560 <p><br><a name="DIAGNOSTICS"></a>
561 <h2>DIAGNOSTICS</h2>
562     
563 <p><br>Most diagnostics issued by the client are logged in a specified log
564 file. The log file name is specified at compile time, but may be
565 overridden on the command line.
566 <p><br>The number and nature of diagnostics available depends on the debug
567 level used by the client. If you have problems, set the debug level to
568 3 and peruse the log files.
569 <p><br><a name="VERSION"></a>
570 <h2>VERSION</h2>
571     
572 <p><br>This man page is correct for version 2.0 of the Samba suite.
573 <p><br><a name="AUTHOR"></a>
574 <h2>AUTHOR</h2>
575     
576 <p><br>The original Samba software and related utilities were created by
577 Andrew Tridgell <a href="mailto:samba-bugs@samba.org"><em>samba-bugs@samba.org</em></a>. Samba is now developed
578 by the Samba Team as an Open Source project similar to the way the
579 Linux kernel is developed.
580 <p><br>The original Samba man pages were written by Karl Auer. The man page
581 sources were converted to YODL format (another excellent piece of Open
582 Source software, available at
583 <a href="ftp://ftp.icce.rug.nl/pub/unix/"><strong>ftp://ftp.icce.rug.nl/pub/unix/</strong></a>)
584 and updated for the Samba2.0 release by Jeremy Allison.
585 <a href="mailto:samba-bugs@samba.org"><em>samba-bugs@samba.org</em></a>.
586 <p><br>See <a href="samba.7.html"><strong>samba (7)</strong></a> to find out how to get a full
587 list of contributors and details on how to submit bug reports,
588 comments etc.
589 </body>
590 </html>