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