source: branches/samba-3.3.x/docs/manpages/smbclient.1@ 222

Last change on this file since 222 was 222, checked in by Herwig Bauernfeind, 17 years ago

Update Samba 3.3 branch to 3.3.2

File size: 43.3 KB
Line 
1.\" Title: smbclient
2.\" Author: [see the "AUTHOR" section]
3.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
4.\" Date: 03/12/2009
5.\" Manual: User Commands
6.\" Source: Samba 3.3
7.\" Language: English
8.\"
9.TH "SMBCLIENT" "1" "03/12/2009" "Samba 3\&.3" "User Commands"
10.\" -----------------------------------------------------------------
11.\" * (re)Define some macros
12.\" -----------------------------------------------------------------
13.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14.\" toupper - uppercase a string (locale-aware)
15.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16.de toupper
17.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
18\\$*
19.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
20..
21.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22.\" SH-xref - format a cross-reference to an SH section
23.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24.de SH-xref
25.ie n \{\
26.\}
27.toupper \\$*
28.el \{\
29\\$*
30.\}
31..
32.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33.\" SH - level-one heading that works better for non-TTY output
34.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35.de1 SH
36.\" put an extra blank line of space above the head in non-TTY output
37.if t \{\
38.sp 1
39.\}
40.sp \\n[PD]u
41.nr an-level 1
42.set-an-margin
43.nr an-prevailing-indent \\n[IN]
44.fi
45.in \\n[an-margin]u
46.ti 0
47.HTML-TAG ".NH \\n[an-level]"
48.it 1 an-trap
49.nr an-no-space-flag 1
50.nr an-break-flag 1
51\." make the size of the head bigger
52.ps +3
53.ft B
54.ne (2v + 1u)
55.ie n \{\
56.\" if n (TTY output), use uppercase
57.toupper \\$*
58.\}
59.el \{\
60.nr an-break-flag 0
61.\" if not n (not TTY), use normal case (not uppercase)
62\\$1
63.in \\n[an-margin]u
64.ti 0
65.\" if not n (not TTY), put a border/line under subheading
66.sp -.6
67\l'\n(.lu'
68.\}
69..
70.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71.\" SS - level-two heading that works better for non-TTY output
72.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73.de1 SS
74.sp \\n[PD]u
75.nr an-level 1
76.set-an-margin
77.nr an-prevailing-indent \\n[IN]
78.fi
79.in \\n[IN]u
80.ti \\n[SN]u
81.it 1 an-trap
82.nr an-no-space-flag 1
83.nr an-break-flag 1
84.ps \\n[PS-SS]u
85\." make the size of the head bigger
86.ps +2
87.ft B
88.ne (2v + 1u)
89.if \\n[.$] \&\\$*
90..
91.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92.\" BB/BE - put background/screen (filled box) around block of text
93.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94.de BB
95.if t \{\
96.sp -.5
97.br
98.in +2n
99.ll -2n
100.gcolor red
101.di BX
102.\}
103..
104.de EB
105.if t \{\
106.if "\\$2"adjust-for-leading-newline" \{\
107.sp -1
108.\}
109.br
110.di
111.in
112.ll
113.gcolor
114.nr BW \\n(.lu-\\n(.i
115.nr BH \\n(dn+.5v
116.ne \\n(BHu+.5v
117.ie "\\$2"adjust-for-leading-newline" \{\
118\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
119.\}
120.el \{\
121\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
122.\}
123.in 0
124.sp -.5v
125.nf
126.BX
127.in
128.sp .5v
129.fi
130.\}
131..
132.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133.\" BM/EM - put colored marker in margin next to block of text
134.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135.de BM
136.if t \{\
137.br
138.ll -2n
139.gcolor red
140.di BX
141.\}
142..
143.de EM
144.if t \{\
145.br
146.di
147.ll
148.gcolor
149.nr BH \\n(dn
150.ne \\n(BHu
151\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
152.in 0
153.nf
154.BX
155.in
156.fi
157.\}
158..
159.\" -----------------------------------------------------------------
160.\" * set default formatting
161.\" -----------------------------------------------------------------
162.\" disable hyphenation
163.nh
164.\" disable justification (adjust text to left margin only)
165.ad l
166.\" -----------------------------------------------------------------
167.\" * MAIN CONTENT STARTS HERE *
168.\" -----------------------------------------------------------------
169.SH "Name"
170smbclient \- ftp\-like client to access SMB/CIFS resources on servers
171.SH "Synopsis"
172.fam C
173.HP \w'\ 'u
174\FCsmbclient\F[] [\-b\ <buffer\ size>] [\-d\ debuglevel] [\-e] [\-L\ <netbios\ name>] [\-U\ username] [\-I\ destinationIP] [\-M\ <netbios\ name>] [\-m\ maxprotocol] [\-A\ authfile] [\-N] [\-g] [\-i\ scope] [\-O\ <socket\ options>] [\-p\ port] [\-R\ <name\ resolve\ order>] [\-s\ <smb\ config\ file>] [\-k] [\-P] [\-c\ <command>]
175.fam
176.fam C
177.HP \w'\ 'u
178\FCsmbclient\F[] {servicename} [password] [\-b\ <buffer\ size>] [\-d\ debuglevel] [\-e] [\-D\ Directory] [\-U\ username] [\-W\ workgroup] [\-M\ <netbios\ name>] [\-m\ maxprotocol] [\-A\ authfile] [\-N] [\-g] [\-l\ log\-basename] [\-I\ destinationIP] [\-E] [\-c\ <command\ string>] [\-i\ scope] [\-O\ <socket\ options>] [\-p\ port] [\-R\ <name\ resolve\ order>] [\-s\ <smb\ config\ file>] [\-T<c|x>IXFqgbNan] [\-k]
179.fam
180.SH "DESCRIPTION"
181.PP
182This tool is part of the
183\fBsamba\fR(7)
184suite\&.
185.PP
186\FCsmbclient\F[]
187is a client that can \'talk\' to an SMB/CIFS server\&. It offers an interface similar to that of the ftp program (see
188\fBftp\fR(1))\&. Operations include things like getting files from the server to the local machine, putting files from the local machine to the server, retrieving directory information from the server and so on\&.
189.SH "OPTIONS"
190.PP
191servicename
192.RS 4
193servicename is the name of the service you want to use on the server\&. A service name takes the form
194\FC//server/service\F[]
195where
196\fIserver \fR
197is the NetBIOS name of the SMB/CIFS server offering the desired service and
198\fIservice\fR
199is the name of the service offered\&. Thus to connect to the service "printer" on the SMB/CIFS server "smbserver", you would use the servicename
200\FC//smbserver/printer \F[]
201.sp
202Note that the server name required is NOT necessarily the IP (DNS) host name of the server ! The name required is a NetBIOS server name, which may or may not be the same as the IP hostname of the machine running the server\&.
203.sp
204The server name is looked up according to either the
205\fI\-R\fR
206parameter to
207\FCsmbclient\F[]
208or using the name resolve order parameter in the
209\fBsmb.conf\fR(5)
210file, allowing an administrator to change the order and methods by which server names are looked up\&.
211.RE
212.PP
213password
214.RS 4
215The password required to access the specified service on the specified server\&. If this parameter is supplied, the
216\fI\-N\fR
217option (suppress password prompt) is assumed\&.
218.sp
219There is no default password\&. If no password is supplied on the command line (either by using this parameter or adding a password to the
220\fI\-U\fR
221option (see below)) and the
222\fI\-N\fR
223option is not specified, the client will prompt for a password, even if the desired service does not require one\&. (If no password is required, simply press ENTER to provide a null password\&.)
224.sp
225Note: Some servers (including OS/2 and Windows for Workgroups) insist on an uppercase password\&. Lowercase or mixed case passwords may be rejected by these servers\&.
226.sp
227Be cautious about including passwords in scripts\&.
228.RE
229.PP
230\-R <name resolve order>
231.RS 4
232This option is used by the programs in the Samba suite to determine what naming services and in what order to resolve host names to IP addresses\&. The option takes a space\-separated string of different name resolution options\&.
233.sp
234The options are :"lmhosts", "host", "wins" and "bcast"\&. They cause names to be resolved as follows:
235.sp
236.RS 4
237.ie n \{\
238\h'-04'\(bu\h'+03'\c
239.\}
240.el \{\
241.sp -1
242.IP \(bu 2.3
243.\}
244\fBlmhosts\fR: Lookup an IP address in the Samba lmhosts file\&. If the line in lmhosts has no name type attached to the NetBIOS name (see the
245\fBlmhosts\fR(5)
246for details) then any name type matches for lookup\&.
247.RE
248.sp
249.RS 4
250.ie n \{\
251\h'-04'\(bu\h'+03'\c
252.\}
253.el \{\
254.sp -1
255.IP \(bu 2.3
256.\}
257\fBhost\fR: Do a standard host name to IP address resolution, using the system
258\FC/etc/hosts \F[], NIS, or DNS lookups\&. This method of name resolution is operating system dependent, for instance on IRIX or Solaris this may be controlled by the
259\FC/etc/nsswitch\&.conf\F[]
260file)\&. Note that this method is only used if the NetBIOS name type being queried is the 0x20 (server) name type, otherwise it is ignored\&.
261.RE
262.sp
263.RS 4
264.ie n \{\
265\h'-04'\(bu\h'+03'\c
266.\}
267.el \{\
268.sp -1
269.IP \(bu 2.3
270.\}
271\fBwins\fR: Query a name with the IP address listed in the
272\fIwins server\fR
273parameter\&. If no WINS server has been specified this method will be ignored\&.
274.RE
275.sp
276.RS 4
277.ie n \{\
278\h'-04'\(bu\h'+03'\c
279.\}
280.el \{\
281.sp -1
282.IP \(bu 2.3
283.\}
284\fBbcast\fR: Do a broadcast on each of the known local interfaces listed in the
285\fIinterfaces\fR
286parameter\&. This is the least reliable of the name resolution methods as it depends on the target host being on a locally connected subnet\&.
287.sp
288.RE
289If this parameter is not set then the name resolve order defined in the
290\fBsmb.conf\fR(5)
291file parameter (name resolve order) will be used\&.
292.sp
293The default order is lmhosts, host, wins, bcast and without this parameter or any entry in the
294\fIname resolve order \fR
295parameter of the
296\fBsmb.conf\fR(5)
297file the name resolution methods will be attempted in this order\&.
298.RE
299.PP
300\-M NetBIOS name
301.RS 4
302This options allows you to send messages, using the "WinPopup" protocol, to another computer\&. Once a connection is established you then type your message, pressing ^D (control\-D) to end\&.
303.sp
304If the receiving computer is running WinPopup the user will receive the message and probably a beep\&. If they are not running WinPopup the message will be lost, and no error message will occur\&.
305.sp
306The message is also automatically truncated if the message is over 1600 bytes, as this is the limit of the protocol\&.
307.sp
308One useful trick is to pipe the message through
309\FCsmbclient\F[]\&. For example: smbclient \-M FRED < mymessage\&.txt will send the message in the file
310\FCmymessage\&.txt\F[]
311to the machine FRED\&.
312.sp
313You may also find the
314\fI\-U\fR
315and
316\fI\-I\fR
317options useful, as they allow you to control the FROM and TO parts of the message\&.
318.sp
319See the
320\fImessage command\fR
321parameter in the
322\fBsmb.conf\fR(5)
323for a description of how to handle incoming WinPopup messages in Samba\&.
324.sp
325\fINote\fR: Copy WinPopup into the startup group on your WfWg PCs if you want them to always be able to receive messages\&.
326.RE
327.PP
328\-p port
329.RS 4
330This number is the TCP port number that will be used when making connections to the server\&. The standard (well\-known) TCP port number for an SMB/CIFS server is 139, which is the default\&.
331.RE
332.PP
333\-g
334.RS 4
335This parameter provides combined with
336\fI\-L\fR
337easy parseable output that allows processing with utilities such as grep and cut\&.
338.RE
339.PP
340\-P
341.RS 4
342Make queries to the external server using the machine account of the local server\&.
343.RE
344.PP
345\-h|\-\-help
346.RS 4
347Print a summary of command line options\&.
348.RE
349.PP
350\-I IP\-address
351.RS 4
352\fIIP address\fR
353is the address of the server to connect to\&. It should be specified in standard "a\&.b\&.c\&.d" notation\&.
354.sp
355Normally the client would attempt to locate a named SMB/CIFS server by looking it up via the NetBIOS name resolution mechanism described above in the
356\fIname resolve order\fR
357parameter above\&. Using this parameter will force the client to assume that the server is on the machine with the specified IP address and the NetBIOS name component of the resource being connected to will be ignored\&.
358.sp
359There is no default for this parameter\&. If not supplied, it will be determined automatically by the client as described above\&.
360.RE
361.PP
362\-E
363.RS 4
364This parameter causes the client to write messages to the standard error stream (stderr) rather than to the standard output stream\&.
365.sp
366By default, the client writes messages to standard output \- typically the user\'s tty\&.
367.RE
368.PP
369\-L
370.RS 4
371This option allows you to look at what services are available on a server\&. You use it as
372\FCsmbclient \-L host\F[]
373and a list should appear\&. The
374\fI\-I \fR
375option may be useful if your NetBIOS names don\'t match your TCP/IP DNS host names or if you are trying to reach a host on another network\&.
376.RE
377.PP
378\-t terminal code
379.RS 4
380This option tells
381\FCsmbclient\F[]
382how to interpret filenames coming from the remote server\&. Usually Asian language multibyte UNIX implementations use different character sets than SMB/CIFS servers (\fIEUC\fR
383instead of
384\fI SJIS\fR
385for example)\&. Setting this parameter will let
386\FCsmbclient\F[]
387convert between the UNIX filenames and the SMB filenames correctly\&. This option has not been seriously tested and may have some problems\&.
388.sp
389The terminal codes include CWsjis, CWeuc, CWjis7, CWjis8, CWjunet, CWhex, CWcap\&. This is not a complete list, check the Samba source code for the complete list\&.
390.RE
391.PP
392\-b buffersize
393.RS 4
394This option changes the transmit/send buffer size when getting or putting a file from/to the server\&. The default is 65520 bytes\&. Setting this value smaller (to 1200 bytes) has been observed to speed up file transfers to and from a Win9x server\&.
395.RE
396.PP
397\-e
398.RS 4
399This command line parameter requires the remote server support the UNIX extensions\&. Request that the connection be encrypted\&. This is new for Samba 3\&.2 and will only work with Samba 3\&.2 or above servers\&. Negotiates SMB encryption using GSSAPI\&. Uses the given credentials for the encryption negotiaion (either kerberos or NTLMv1/v2 if given domain/username/password triple\&. Fails the connection if encryption cannot be negotiated\&.
400.RE
401.PP
402\-d|\-\-debuglevel=level
403.RS 4
404\fIlevel\fR
405is an integer from 0 to 10\&. The default value if this parameter is not specified is 1\&.
406.sp
407The higher this value, the more detail will be logged to the log files about the activities of the server\&. At level 0, only critical errors and serious warnings will be logged\&. Level 1 is a reasonable level for day\-to\-day running \- it generates a small amount of information about operations carried out\&.
408.sp
409Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem\&. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic\&.
410.sp
411Note that specifying this parameter here will override the
412\m[blue]\fBlog level\fR\m[]
413parameter in the
414\FCsmb\&.conf\F[]
415file\&.
416.RE
417.PP
418\-V
419.RS 4
420Prints the program version number\&.
421.RE
422.PP
423\-s <configuration file>
424.RS 4
425The file specified contains the configuration details required by the server\&. The information in this file includes server\-specific information such as what printcap file to use, as well as descriptions of all the services that the server is to provide\&. See
426\FCsmb\&.conf\F[]
427for more information\&. The default configuration file name is determined at compile time\&.
428.RE
429.PP
430\-l|\-\-log\-basename=logdirectory
431.RS 4
432Base directory name for log/debug files\&. The extension
433\fB"\&.progname"\fR
434will be appended (e\&.g\&. log\&.smbclient, log\&.smbd, etc\&.\&.\&.)\&. The log file is never removed by the client\&.
435.RE
436.PP
437\-N
438.RS 4
439If specified, this parameter suppresses the normal password prompt from the client to the user\&. This is useful when accessing a service that does not require a password\&.
440.sp
441Unless a password is specified on the command line or this parameter is specified, the client will request a password\&.
442.sp
443If a password is specified on the command line and this option is also defined the password on the command line will be silently ingnored and no password will be used\&.
444.RE
445.PP
446\-k
447.RS 4
448Try to authenticate with kerberos\&. Only useful in an Active Directory environment\&.
449.RE
450.PP
451\-A|\-\-authentication\-file=filename
452.RS 4
453This option allows you to specify a file from which to read the username and password used in the connection\&. The format of the file is
454.sp
455.if n \{\
456.RS 4
457.\}
458.fam C
459.ps -1
460.nf
461.if t \{\
462.sp -1
463.\}
464.BB lightgray adjust-for-leading-newline
465.sp -1
466
467username = <value>
468password = <value>
469domain = <value>
470.EB lightgray adjust-for-leading-newline
471.if t \{\
472.sp 1
473.\}
474.fi
475.fam
476.ps +1
477.if n \{\
478.RE
479.\}
480.sp
481Make certain that the permissions on the file restrict access from unwanted users\&.
482.RE
483.PP
484\-U|\-\-user=username[%password]
485.RS 4
486Sets the SMB username or username and password\&.
487.sp
488If %password is not specified, the user will be prompted\&. The client will first check the
489\fBUSER\fR
490environment variable, then the
491\fBLOGNAME\fR
492variable and if either exists, the string is uppercased\&. If these environmental variables are not found, the username
493\fBGUEST\fR
494is used\&.
495.sp
496A third option is to use a credentials file which contains the plaintext of the username and password\&. This option is mainly provided for scripts where the admin does not wish to pass the credentials on the command line or via environment variables\&. If this method is used, make certain that the permissions on the file restrict access from unwanted users\&. See the
497\fI\-A\fR
498for more details\&.
499.sp
500Be cautious about including passwords in scripts\&. Also, on many systems the command line of a running process may be seen via the
501\FCps\F[]
502command\&. To be safe always allow
503\FCrpcclient\F[]
504to prompt for a password and type it in directly\&.
505.RE
506.PP
507\-n <primary NetBIOS name>
508.RS 4
509This option allows you to override the NetBIOS name that Samba uses for itself\&. This is identical to setting the
510\m[blue]\fBnetbios name\fR\m[]
511parameter in the
512\FCsmb\&.conf\F[]
513file\&. However, a command line setting will take precedence over settings in
514\FCsmb\&.conf\F[]\&.
515.RE
516.PP
517\-i <scope>
518.RS 4
519This specifies a NetBIOS scope that
520\FCnmblookup\F[]
521will use to communicate with when generating NetBIOS names\&. For details on the use of NetBIOS scopes, see rfc1001\&.txt and rfc1002\&.txt\&. NetBIOS scopes are
522\fIvery\fR
523rarely used, only set this parameter if you are the system administrator in charge of all the NetBIOS systems you communicate with\&.
524.RE
525.PP
526\-W|\-\-workgroup=domain
527.RS 4
528Set the SMB domain of the username\&. This overrides the default domain which is the domain defined in smb\&.conf\&. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM)\&.
529.RE
530.PP
531\-O socket options
532.RS 4
533TCP socket options to set on the client socket\&. See the socket options parameter in the
534\FCsmb\&.conf\F[]
535manual page for the list of valid options\&.
536.RE
537.PP
538\-T tar options
539.RS 4
540smbclient may be used to create
541\FCtar(1) \F[]
542compatible backups of all the files on an SMB/CIFS share\&. The secondary tar flags that can be given to this option are :
543.sp
544.RS 4
545.ie n \{\
546\h'-04'\(bu\h'+03'\c
547.\}
548.el \{\
549.sp -1
550.IP \(bu 2.3
551.\}
552\fIc\fR
553\- Create a tar file on UNIX\&. Must be followed by the name of a tar file, tape device or "\-" for standard output\&. If using standard output you must turn the log level to its lowest value \-d0 to avoid corrupting your tar file\&. This flag is mutually exclusive with the
554\fIx\fR
555flag\&.
556.RE
557.sp
558.RS 4
559.ie n \{\
560\h'-04'\(bu\h'+03'\c
561.\}
562.el \{\
563.sp -1
564.IP \(bu 2.3
565.\}
566\fIx\fR
567\- Extract (restore) a local tar file back to a share\&. Unless the \-D option is given, the tar files will be restored from the top level of the share\&. Must be followed by the name of the tar file, device or "\-" for standard input\&. Mutually exclusive with the
568\fIc\fR
569flag\&. Restored files have their creation times (mtime) set to the date saved in the tar file\&. Directories currently do not get their creation dates restored properly\&.
570.RE
571.sp
572.RS 4
573.ie n \{\
574\h'-04'\(bu\h'+03'\c
575.\}
576.el \{\
577.sp -1
578.IP \(bu 2.3
579.\}
580\fII\fR
581\- Include files and directories\&. Is the default behavior when filenames are specified above\&. Causes files to be included in an extract or create (and therefore everything else to be excluded)\&. See example below\&. Filename globbing works in one of two ways\&. See
582\fIr\fR
583below\&.
584.RE
585.sp
586.RS 4
587.ie n \{\
588\h'-04'\(bu\h'+03'\c
589.\}
590.el \{\
591.sp -1
592.IP \(bu 2.3
593.\}
594\fIX\fR
595\- Exclude files and directories\&. Causes files to be excluded from an extract or create\&. See example below\&. Filename globbing works in one of two ways now\&. See
596\fIr\fR
597below\&.
598.RE
599.sp
600.RS 4
601.ie n \{\
602\h'-04'\(bu\h'+03'\c
603.\}
604.el \{\
605.sp -1
606.IP \(bu 2.3
607.\}
608\fIF\fR
609\- File containing a list of files and directories\&. The
610\fIF\fR
611causes the name following the tarfile to create to be read as a filename that contains a list of files and directories to be included in an extract or create (and therefore everything else to be excluded)\&. See example below\&. Filename globbing works in one of two ways\&. See
612\fIr\fR
613below\&.
614.RE
615.sp
616.RS 4
617.ie n \{\
618\h'-04'\(bu\h'+03'\c
619.\}
620.el \{\
621.sp -1
622.IP \(bu 2.3
623.\}
624\fIb\fR
625\- Blocksize\&. Must be followed by a valid (greater than zero) blocksize\&. Causes tar file to be written out in blocksize*TBLOCK (usually 512 byte) blocks\&.
626.RE
627.sp
628.RS 4
629.ie n \{\
630\h'-04'\(bu\h'+03'\c
631.\}
632.el \{\
633.sp -1
634.IP \(bu 2.3
635.\}
636\fIg\fR
637\- Incremental\&. Only back up files that have the archive bit set\&. Useful only with the
638\fIc\fR
639flag\&.
640.RE
641.sp
642.RS 4
643.ie n \{\
644\h'-04'\(bu\h'+03'\c
645.\}
646.el \{\
647.sp -1
648.IP \(bu 2.3
649.\}
650\fIq\fR
651\- Quiet\&. Keeps tar from printing diagnostics as it works\&. This is the same as tarmode quiet\&.
652.RE
653.sp
654.RS 4
655.ie n \{\
656\h'-04'\(bu\h'+03'\c
657.\}
658.el \{\
659.sp -1
660.IP \(bu 2.3
661.\}
662\fIr\fR
663\- Regular expression include or exclude\&. Uses regular expression matching for excluding or excluding files if compiled with HAVE_REGEX_H\&. However this mode can be very slow\&. If not compiled with HAVE_REGEX_H, does a limited wildcard match on \'*\' and \'?\'\&.
664.RE
665.sp
666.RS 4
667.ie n \{\
668\h'-04'\(bu\h'+03'\c
669.\}
670.el \{\
671.sp -1
672.IP \(bu 2.3
673.\}
674\fIN\fR
675\- Newer than\&. Must be followed by the name of a file whose date is compared against files found on the share during a create\&. Only files newer than the file specified are backed up to the tar file\&. Useful only with the
676\fIc\fR
677flag\&.
678.RE
679.sp
680.RS 4
681.ie n \{\
682\h'-04'\(bu\h'+03'\c
683.\}
684.el \{\
685.sp -1
686.IP \(bu 2.3
687.\}
688\fIa\fR
689\- Set archive bit\&. Causes the archive bit to be reset when a file is backed up\&. Useful with the
690\fIg\fR
691and
692\fIc\fR
693flags\&.
694.sp
695.RE
696\fITar Long File Names\fR
697.sp
698\FCsmbclient\F[]\'s tar option now supports long file names both on backup and restore\&. However, the full path name of the file must be less than 1024 bytes\&. Also, when a tar archive is created,
699\FCsmbclient\F[]\'s tar option places all files in the archive with relative names, not absolute names\&.
700.sp
701\fITar Filenames\fR
702.sp
703All file names can be given as DOS path names (with \'\e\e\' as the component separator) or as UNIX path names (with \'/\' as the component separator)\&.
704.sp
705\fIExamples\fR
706.sp
707Restore from tar file
708\FCbackup\&.tar\F[]
709into myshare on mypc (no password on share)\&.
710.sp
711\FCsmbclient //mypc/yshare "" \-N \-Tx backup\&.tar \F[]
712.sp
713Restore everything except
714\FCusers/docs\F[]
715.sp
716\FCsmbclient //mypc/myshare "" \-N \-TXx backup\&.tar users/docs\F[]
717.sp
718Create a tar file of the files beneath
719\FC users/docs\F[]\&.
720.sp
721\FCsmbclient //mypc/myshare "" \-N \-Tc backup\&.tar users/docs \F[]
722.sp
723Create the same tar file as above, but now use a DOS path name\&.
724.sp
725\FCsmbclient //mypc/myshare "" \-N \-tc backup\&.tar users\eedocs \F[]
726.sp
727Create a tar file of the files listed in the file
728\FCtarlist\F[]\&.
729.sp
730\FCsmbclient //mypc/myshare "" \-N \-TcF backup\&.tar tarlist\F[]
731.sp
732Create a tar file of all the files and directories in the share\&.
733.sp
734\FCsmbclient //mypc/myshare "" \-N \-Tc backup\&.tar * \F[]
735.RE
736.PP
737\-D initial directory
738.RS 4
739Change to initial directory before starting\&. Probably only of any use with the tar \-T option\&.
740.RE
741.PP
742\-c command string
743.RS 4
744command string is a semicolon\-separated list of commands to be executed instead of prompting from stdin\&.
745\fI \-N\fR
746is implied by
747\fI\-c\fR\&.
748.sp
749This is particularly useful in scripts and for printing stdin to the server, e\&.g\&.
750\FC\-c \'print \-\'\F[]\&.
751.RE
752.SH "OPERATIONS"
753.PP
754Once the client is running, the user is presented with a prompt :
755.PP
756\FCsmb:\e> \F[]
757.PP
758The backslash ("\e\e") indicates the current working directory on the server, and will change if the current working directory is changed\&.
759.PP
760The prompt indicates that the client is ready and waiting to carry out a user command\&. Each command is a single word, optionally followed by parameters specific to that command\&. Command and parameters are space\-delimited unless these notes specifically state otherwise\&. All commands are case\-insensitive\&. Parameters to commands may or may not be case sensitive, depending on the command\&.
761.PP
762You can specify file names which have spaces in them by quoting the name with double quotes, for example "a long file name"\&.
763.PP
764Parameters shown in square brackets (e\&.g\&., "[parameter]") are optional\&. If not given, the command will use suitable defaults\&. Parameters shown in angle brackets (e\&.g\&., "<parameter>") are required\&.
765.PP
766Note that all commands operating on the server are actually performed by issuing a request to the server\&. Thus the behavior may vary from server to server, depending on how the server was implemented\&.
767.PP
768The commands available are given here in alphabetical order\&.
769.PP
770? [command]
771.RS 4
772If
773\fIcommand\fR
774is specified, the ? command will display a brief informative message about the specified command\&. If no command is specified, a list of available commands will be displayed\&.
775.RE
776.PP
777! [shell command]
778.RS 4
779If
780\fIshell command\fR
781is specified, the ! command will execute a shell locally and run the specified shell command\&. If no command is specified, a local shell will be run\&.
782.RE
783.PP
784allinfo file
785.RS 4
786The client will request that the server return all known information about a file or directory (including streams)\&.
787.RE
788.PP
789altname file
790.RS 4
791The client will request that the server return the "alternate" name (the 8\&.3 name) for a file or directory\&.
792.RE
793.PP
794archive <number>
795.RS 4
796Sets the archive level when operating on files\&. 0 means ignore the archive bit, 1 means only operate on files with this bit set, 2 means only operate on files with this bit set and reset it after operation, 3 means operate on all files and reset it after operation\&. The default is 0\&.
797.RE
798.PP
799blocksize <number>
800.RS 4
801Sets the blocksize parameter for a tar operation\&. The default is 20\&. Causes tar file to be written out in blocksize*TBLOCK (normally 512 byte) units\&.
802.RE
803.PP
804cancel jobid0 [jobid1] \&.\&.\&. [jobidN]
805.RS 4