Learned about the label() and link() commands and how to use url()
[kai/samba.git] / docs / yodldocs / smbclient.1.yo
1 mailto(samba-bugs@samba.anu.edu.au) 
2
3 manpage(smbclient)(1)(23 Oct 1998)(Samba)(SAMBA)
4
5 label(NAME)
6 manpagename(smbclient)(ftp-like client to access SMB/CIFS resources on servers)
7
8 label(SYNOPSIS)
9 manpagesynopsis()
10
11 bf(smbclient) service [password] [-s smb.conf] [-B IP addr] [-O socket_options][-R name resolve order] [-M NetBIOS name] [-i scope] [-N] [-n NetBIOS name] [-d debuglevel] [-P] [-p port] [-l log basename] [-h] [-I dest IP] [-E] [-U username] [-L NetBIOS name] [-t terminal code] [-m max protocol] [-W workgroup] [-T<c|x>IXFqgbNan] [-D directory] [-c command string]
12
13 label(DESCRIPTION)
14 manpagedescription()
15
16 This program is part of the bf(Samba) suite.
17
18 bf(smbclient) is a client that can 'talk' to an SMB/CIFS server. It
19 offers an interface similar to that of the ftp program (see bf(ftp
20 (1))).  Operations include things like getting files from the server
21 to the local machine, putting files from the local machine to the
22 server, retrieving directory information from the server and so on.
23
24 label(OPTIONS)
25 manpageoptions()
26
27 startdit()
28
29 dit(bf(servicename)) servicename is the name of the service you want
30 to use on the server. A service name takes the form
31 tt(//server/service) where em(server) is the NetBIOS name of the SMB/CIFS
32 server offering the desired service and em(service) is the name
33 of the service offered. Thus to connect to the service em(printer) on
34 the SMB/CIFS server em(lanman), you would use the servicename
35
36 tt(//lanman/printer)
37
38 Note that the server name required is NOT necessarily the host name of
39 the server! The name required is a NetBIOS server name, which may or
40 may not be the same as the IP (DNS) hostname of the machine running
41 the server.
42
43 The server name is looked up according to the bf(name resolve order)
44 parameter in the smb.conf file, allowing an administrator to change
45 the order and methods by which server names are looked up.
46
47 dit(bf(password)) password is the password required to access the
48 specified service on the specified server. If this parameter is
49 supplied, the bf(-N) option (suppress password prompt) is assumed.
50
51 There is no default password. If no password is supplied on the
52 command line (either by using this parameter or adding a password to
53 the bf(-U) option (see below)) and the bf(-N) option is not specified,
54 the client will prompt for a password, even if the desired service
55 does not require one. (If no password is required, simply press ENTER
56 to provide a null password.)
57
58 Note: Some servers (including OS/2 and Windows for Workgroups) insist
59 on an uppercase password. Lowercase or mixed case passwords may be
60 rejected by these servers.
61
62 Be cautious about including passwords in scripts.
63
64 dit(bf(-s smb.conf)) This parameter specifies the pathname to the
65 Samba configuration file, smb.conf. This file controls all aspects of
66 the Samba setup on the machine and smbclient also needs to read this
67 file.
68
69 dit(bf(-B IP addr)) The IP address to use when sending a broadcast packet.
70
71 dit(bf(-O socket_options)) TCP socket options to set on the client socket.
72
73 dit(bf(-R name resolve order)) This option allows the user of
74 smbclient to determine what name resolution services to use when
75 looking up the NetBIOS name of the host being connected to.
76
77 The options are :"lmhosts", "host", "wins" and "bcast". They cause
78 names to be resolved as follows :
79
80 startit()
81
82 it() bf(lmhosts) : Lookup an IP address in the Samba lmhosts file.
83
84 it() bf(host) : Do a standard host name to IP address resolution,
85 using the system /etc/hosts, NIS, or DNS lookups. This method of name
86 resolution is operating system depended for instance on IRIX or
87 Solaris this may be controlled by the em(/etc/nsswitch.conf) file).  
88
89 it() bf(wins) : Query a name with the IP address listed in the bf(wins
90 server) parameter in the smb.conf file. If no WINS server has been
91 specified this method will be ignored.
92
93 it() bf(bcast) : Do a broadcast on each of the known local interfaces
94 listed in the bf(interfaces) parameter in the smb.conf file. This is
95 the least reliable of the name resolution methods as it depends on the
96 target host being on a locally connected subnet. To specify a
97 particular broadcast address the bf(-B) option may be used.
98
99 endit()
100
101 The default order is lmhosts, host, wins, bcast and without this
102 parameter the name resolution methods will be attempted in this order.
103
104 dit(bf(-M NetBIOS name)) This options allows you to send messages,
105 using the "WinPopup" protocol, to another computer. Once a connection
106 is established you then type your message, pressing ^D (control-D) to
107 end.
108
109 If the receiving computer is running WinPopup the user will receive
110 the message and probably a beep. If they are not running WinPopup the
111 message will be lost, and no error message will occur.
112
113 The message is also automatically truncated if the message is over
114 1600 bytes, as this is the limit of the protocol.
115
116 One useful trick is to cat the message through bf(smbclient).
117 For example:
118
119 tt(cat mymessage.txt | smbclient -M FRED)
120
121 will send the message in the file em(mymessage.txt) to the machine FRED.
122
123 You may also find the bf(-U) and bf(-I) options useful, as they allow
124 you to control the FROM and TO parts of the message.
125
126 See the message command section of bf(smb.conf (5)) for a description
127 of how to handle incoming WinPopup messages in Samba.
128
129 Note: Copy WinPopup into the startup group on your WfWg PCs if you
130 want them to always be able to receive messages.
131
132 dit(bf(-i scope)) This specifies a NetBIOS scope that smbclient will use
133 to communicate with when generating NetBIOS names. For details on the
134 use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes
135 are em(very) rarely used, only set this parameter if you are the
136 system administrator in charge of all the NetBIOS systems you
137 communicate with.
138
139 dit(bf(-N)) If specified, this parameter suppresses the normal
140 password prompt from the client to the user. This is useful when
141 accessing a service that does not require a password.
142
143 Unless a password is specified on the command line or this parameter
144 is specified, the client will request a password.
145
146 dit(bf(-n NetBIOS name)) By default, the client will use the local
147 machine's hostname (in uppercase) as its NetBIOS name. This parameter
148 allows you to override the host name and use whatever NetBIOS name you
149 wish.
150
151 dit(bf(-d debuglevel)) debuglevel is an integer from 0 to 10, or the
152 letter 'A'.
153
154 The default value if this parameter is not specified is zero.
155
156 The higher this value, the more detail will be logged to the log files
157 about the activities of the client. At level 0, only critical errors
158 and serious warnings will be logged. Level 1 is a reasonable level for
159 day to day running - it generates a small amount of information about
160 operations carried out.
161
162 Levels above 1 will generate considerable amounts of log data, and should 
163 only be used when investigating a problem. Levels above 3 are designed for 
164 use only by developers and generate HUGE amounts of log data, most of which 
165 is extremely cryptic.
166 .RE
167
168
169
170   DEBUG(0,("\t-d debuglevel         set the debuglevel\n"));
171   DEBUG(0,("\t-P                    connect to service as a printer\n"));
172   DEBUG(0,("\t-p port               connect to the specified port\n"));
173   DEBUG(0,("\t-l log basename.      Basename for log/debug files\n"));
174   DEBUG(0,("\t-h                    Print this help message.\n"));
175   DEBUG(0,("\t-I dest IP            use this IP to connect to\n"));
176   DEBUG(0,("\t-E                    write messages to stderr instead of stdout\n"));
177   DEBUG(0,("\t-U username           set the network username\n"));
178   DEBUG(0,("\t-L host               get a list of shares available on a host\n"));
179   DEBUG(0,("\t-t terminal code      terminal i/o code {sjis|euc|jis7|jis8|junet|hex}\n"));
180   DEBUG(0,("\t-m max protocol       set the max protocol level\n"));
181   DEBUG(0,("\t-W workgroup          set the workgroup name\n"));
182   DEBUG(0,("\t-T<c|x>IXFqgbNan      command line tar\n"));
183   DEBUG(0,("\t-D directory          start from directory\n"));
184   DEBUG(0,("\t-c command string     execute semicolon separated commands\n"));
185
186 .B \-R name resolve order
187
188 .RS 3
189 This parameter will override the default name resolution order of the
190 server listed in the "name resolve order" parameter in smb.conf. This
191 is useful to force name resolution to take place by a particular method.
192 This command line parameter only exists in Samba 1.9.18p4 and above.
193 .RE
194
195 .B \-A
196
197 .RS 3
198 This parameter, if specified, causes the maximum debug level to be selected.
199 Be warned that this generates prodigious amounts of debug data. There is also
200 a security issue involved, as at the maximum debug level cleartext passwords
201 may be written to some log files.
202 .RE
203
204 .B \-L
205
206 .RS 3
207 This option allows you to look at what services are available on a
208 server. You use it as "smbclient -L host" and a list should appear.
209 The
210 .B \-I
211 option may be useful if your NetBIOS names don't match your 
212 tcp/ip host names or if you are trying to reach a host on another
213 network. For example:
214
215 smbclient -L ftp -I ftp.microsoft.com
216
217 will list the shares available on Microsoft's public server.
218 .RE
219
220 .RS 3
221 .RE
222
223 .B \-E
224
225 .RS 3
226 This parameter, if specified, causes the client to write messages to the
227 standard error stream (stderr) rather than to the standard output stream.
228
229 By default, the client writes messages to standard output - typically the
230 user's tty.
231 .RE
232
233 .B \-I
234 .I IP number
235
236 .RS 3
237 .I IP number
238 represents the IP number of the server to connect to. It should
239 be specified in standard "a.b.c.d" notation.
240
241 Normally the client will attempt to locate the specified Lan Manager server
242 by looking it up - that is, broadcasting a request for the given server to
243 identify itself. Using this parameter will force the client to assume that
244 the server is on the machine with the specified IP number.
245
246 There is no default for this parameter. If not supplied, it will be determined
247 automatically by the client as described above.
248 .RE
249
250 .B \-O
251 .I socket options
252
253 .RS 3
254 See the socket options section of
255 .BR smb.conf (5)
256 for details.
257 .RE
258
259 .B \-P
260
261 .RS 3
262 If specified, the service requested will be connected to as a printer service
263 rather than as a normal filespace service. Operations such as put and get
264 will not be applicable for such a connection.
265
266 By default, services will be connected to as NON-printer services.
267 .RE
268
269 .B \-U
270 .I username
271
272 .RS 3
273 .I username
274 is the user name that will be used by the client to make a connection,
275 assuming your server is running a protocol that allows for usernames.
276
277 Some servers are fussy about the case of this name, and some insist
278 that it must be a valid NetBIOS name.
279
280 If no 
281 .I username
282 is supplied, it will default to an uppercase version of the 
283 environment variable 
284 .B USER
285 or
286 .B LOGNAME
287 in that order.
288 If no 
289 .I username
290 is supplied and neither environment variable exists the user name will
291 be empty.
292
293 If the USER environment variable containts a '%' character, everything
294 after that will be treated as a password. This allows you to set the
295 environment variable to be
296 .B USER=username%password
297 so that a password is not passed on the command line (where it may
298 be seen by the ps command).
299
300 If the service you are connecting to requires a password, it can be supplied
301 using the
302 .B \-U
303 option, by appending a percent symbol ("%") then the password to 
304 .I username.
305 For example, to attach to a service as user "fred" with password "secret", you
306 would specify
307 .B \-U
308 .I fred%secret
309 on the command line. Note that there are no spaces around the percent symbol.
310
311 If you specify the password as part of
312 .I username
313 then the 
314 .B \-N
315 option (suppress password prompt) is assumed.
316
317 If you specify the password as a parameter AND as part of
318 .I username
319 then the password as part of
320 .I username
321 will take precedence. Putting nothing before or nothing after the percent 
322 symbol will cause an empty username or an empty password to be used,
323 respectively.
324
325 Note: Some servers (including OS/2 and Windows for Workgroups) insist
326 on an uppercase password. Lowercase or mixed case passwords may be
327 rejected by these servers.
328
329 Be cautious about including passwords in scripts.
330 .RE
331
332 .B \-l
333 .I log basename
334
335 .RS 3
336 If specified,
337 .I log basename
338 specifies a base filename into which operational data from the running client
339 will be logged.
340
341 The default base name is specified at compile time.
342
343 The base name is used to generate actual log file names. For example, if the
344 name specified was "log", the following files would be used for log data:
345
346 .RS 3
347 log.client.debug (containing debugging information)
348
349 log.client.in (containing inbound transaction data)
350
351 log.client.out (containing outbound transaction data)
352 .RE
353
354 The log files generated are never removed by the client.
355 .RE
356
357 .B \-W
358 .I workgroup
359
360 .RS 3
361 Override what workgroup is used for the connection. This may be needed
362 to connect to some servers.
363 .RE
364
365 .B \-p
366 .I port number
367
368 .RS 3
369 port number is a positive integer value.
370
371 The default value if this parameter is not specified is 139.
372
373 This number is the port number that will be used when making connections to
374 the server. The standard (well-known) port number for the server is 139, 
375 hence the default.
376
377 This parameter is not normally specified.
378 .RE
379
380 .B \-T
381 .I tar options
382
383 .RS 3 
384 where
385 .I tar options
386 consists of one or more of
387 .BR c ,
388 .BR x ,
389 .BR I ,
390 .BR X ,
391 .BR b ,
392 .BR g ,
393 .BR q ,
394 .BR N
395 or
396 .BR a ;
397 used as:
398 .LP
399 smbclient 
400 .B "\e\eserver\eshare"
401 \-TcxIXbgNa
402 [
403 .IR blocksize
404 ]
405 [
406 .IR newer-file
407 ]
408 .IR tarfile
409 [
410 .IR filenames ...
411 ]
412
413 .RS 3
414 .B c
415 Create a tar file on UNIX. Must be followed by the name of a tar file,
416 tape device or "\-" for standard output. (May be useful to set debugging
417 low
418 .RB ( -d0 ))
419 to avoid corrupting your tar file if using "\-"). Mutually
420 exclusive with the
421 .B x
422 flag.
423
424 .B x
425 Extract (restore) a local tar file back to a share. Unless the
426 .B \-D
427 option is given, the tar files will be restored from the top level of
428 the share. Must be followed by the name of the tar file, device or "\-"
429 for standard input. Mutually exclusive with the
430 .B c
431 flag. Restored files have theuir creation times (mtime) set to the date saved in
432 the tar file. Directories currently do not get their creation dates restored 
433 properly.
434
435 .B I
436 Include files and directories. Is the default behaviour when
437 .IR filenames
438 are specified above. Causes tar files to be included in an extract or create
439 (and therefore everything else to be excluded). See example below.
440 Filename globbing does not work for included files for extractions (yet).
441
442 .B X
443 Exclude files and directories. Causes tar files to be excluded from
444 an extract or create. See example below.
445 Filename globbing does not work for excluded files (yet).
446
447 .B b
448 Blocksize. Must be followed by a valid (greater than zero) blocksize.
449 Causes tar file to be written out in blocksize*TBLOCK (usually 512 byte)
450 blocks.
451
452 .B g
453 Incremental. Only back up files that have the archive bit set. Useful
454 only with the
455 .B c
456 flag.
457
458 .B q
459 Quiet. Keeps tar from printing diagnostics as it works.  This is the
460 same as tarmode quiet.
461
462 .B N
463 Newer than. Must be followed by the name of a file whose date is
464 compared against files found on the share during a create. Only files
465 newer than the file specified are backed up to the tar file. Useful
466 only with the
467 .B c
468 flag.
469
470 .B a
471 Set archive bit. Causes the archive bit to be reset when a file is backed
472 up. Useful with the
473 .B g
474 (and
475 .BR c )
476 flags.
477 .LP
478
479 .B Long File Names
480
481 smbclient's tar option now supports long file names both on backup and 
482 restore. However, the full path name of the file must be less than 1024 bytes.
483 Also, when a tar archive is created, smbclient's tar option places all files 
484 in the archive with relative names, not absolute names.
485
486 .B Filenames ...
487
488 All file names can be given as DOS path names (with \e as the component 
489 separator) or as UNIX path names (with / as the component separator).
490
491 .B Examples
492
493 smbclient \e\emypc\emyshare "" -N -Tx backup.tar
494
495 Restore from tar file backup.tar into myshare on mypc (no password on share).
496
497 smbclient \e\emypc\emyshare "" -N -TXx backup.tar users/docs
498
499 Restore everything except users/docs
500
501 smbclient \e\emypc\emyshare "" -N -Tc backup.tar users/docs
502
503 Create a tar file of the files beneath users/docs.
504
505 smbclient \e\emypc\emyshare "" -N -tc backup.tar users\edocs
506
507 Create the same tar file as above, but now use a DOS path name.
508
509 smbclient \e\emypc\emyshare "" -N -Tc backup.tar \e*
510
511 Create a tar file of all the files and directories in the share.
512 .RE
513 .RE
514
515 .B \-D
516 .I initial directory
517
518 .RS 3 
519 Change to initial directory before starting. Probably only of any use
520 with the tar
521 .RB ( \-T )
522 option.
523 .RE
524
525 .B \-c
526 .I command string
527
528 .RS 3
529 command string is a semicolon separated list of commands to be
530 executed instead of prompting from stdin.
531 .B \-N
532 is implied by
533 .BR \-c .
534
535 This is particularly useful in scripts and for printing stdin to
536 the server, e.g. \-c 'print \-'.
537 .RE
538 .SH OPERATIONS
539 Once the client is running, the user is presented with a prompt, "smb: \e>".
540 The backslash ("\e") indicates the current working directory on the server,
541 and will change if the current working directory is changed.
542
543 The prompt indicates that the client is ready and waiting to carry out a user
544 command. Each command is a single word, optionally followed by parameters
545 specific to that command. Command and parameters are space-delimited unless
546 these notes specifically state otherwise. All commands are case-insensitive.
547 Parameters to commands may or may not be case sensitive, depending on the
548 command.
549
550 You can specify file names which have spaces in them by quoting the
551 name with double quotes, for example "a long file name".
552
553 Parameters shown in square brackets (eg., "[parameter]") are optional. If not
554 given, the command will use suitable defaults. Parameters shown in angle
555 brackets (eg., "<parameter>") are required.
556
557 Note that all commands operating on the server are actually performed by
558 issuing a request to the server. Thus the behaviour may vary from server to
559 server, depending on how the server was implemented.
560
561 The commands available are given here in alphabetical order.
562
563 .B ?
564 .RS 3
565 .B Parameters:
566 .RS 3
567 .I [command]
568
569 .RE
570 .B Description:
571 .RS 3
572 If
573 .I command
574 is specified, the
575 .B ?
576 command will display a brief informative message about the specified command.
577
578 If no command is specified, a list of available commands will be displayed.
579 .RE
580 .RE
581
582 .B !
583 .RS 3
584 .B Parameters:
585 .RS 3
586 .I [shell command]
587
588 .RE
589 .B Description:
590 .RS 3
591 If
592 .I shell command
593 is specified, the
594 .B !
595 command will execute a shell locally and run the specified shell command. If
596 no command is specified, a shell will be run.
597 .RE
598 .RE
599
600 .B cd
601 .RS 3
602 .B Parameters:
603 .RS 3
604 .I [directory name]
605
606 .RE
607 .B Description:
608 .RS 3
609 If
610 .I directory name
611 is specified, the current working directory
612 .B on the server
613 will be changed to the directory specified. This operation will fail if for
614 any reason the specified directory is inaccessible.
615
616 If no directory name is specified, the current working directory
617 .B on the server
618 will be reported.
619 .RE
620 .RE
621
622 .B del
623 .RS 3
624 .B Parameters:
625 .RS 3
626 .I <mask>
627
628 .RE
629 .B Description:
630 .RS 3
631 The client will request that the server attempt to delete all files matching
632 .I mask
633 from the current working directory
634 .B on the server.
635 .RE
636 .RE
637
638 .B dir
639 .RS 3
640 .B Parameters:
641 .RS 3
642 .I <mask>
643
644 .RE
645 .B Description:
646 .RS 3
647 A list of the files matching
648 .I mask
649 in the current working directory
650 .B on the server
651 will be retrieved from the server and displayed.
652 .RE
653 .RE
654
655 .B exit
656 .RS 3
657 .B Parameters:
658 .RS 3
659 None.
660
661 .RE
662 .B Description:
663 .RS 3
664 Terminate the connection with the server and exit from the program.
665 .RE
666 .RE
667
668 .B get
669 .RS 3
670 .B Parameters:
671 .RS 3
672 .I <remote file name> [local file name]
673
674 .RE
675 .B Description:
676 .RS 3
677 Copy the file called
678 .I remote file name
679 from the server to the machine running the client. If specified, name the
680 local copy
681 .I local file name.
682 Note that all transfers in
683 .B smbclient
684 are binary. See also the
685 .B lowercase
686 command.
687 .RE
688 .RE
689
690 .B help
691 .RS 3
692 .B Parameters:
693 .RS 3
694 .I [command]
695
696 .RE
697 .B Description:
698 .RS 3
699 See the
700 .B ?
701 command above.
702 .RE
703 .RE
704
705 .B lcd
706 .RS 3
707 .B Parameters:
708 .RS 3
709 .I [directory name]
710
711 .RE
712 .B Description:
713 .RS 3
714 If
715 .I directory name
716 is specified, the current working directory
717 .B on the local machine
718 will be changed to the directory specified. This operation will fail if for
719 any reason the specified directory is inaccessible.
720
721 If no directory name is specified, the name of the current working directory
722 .B on the local machine
723 will be reported.
724 .RE
725 .RE
726
727 .B lowercase
728 .RS 3
729 .B Parameters:
730 .RS 3
731 None.
732
733 .RE
734 .B Description:
735 .RS 3
736 Toggle lowercasing of filenames for the
737 .B get
738 and
739 .B mget
740 commands.
741
742 When lowercasing is toggled ON, local filenames are converted to lowercase
743 when using the
744 .B get
745 and
746 .B mget
747 commands. This is often useful when copying (say) MSDOS files from a server,
748 because lowercase filenames are the norm on UNIX systems.
749 .RE
750 .RE
751
752 .B ls
753 .RS 3
754 .B Parameters:
755 .RS 3
756 .I <mask>
757
758 .RE
759 .B Description:
760 .RS 3
761 See the
762 .B dir
763 command above.
764 .RE
765 .RE
766
767 .B mask
768 .RS 3
769 .B Parameters:
770 .RS 3
771 .I <mask>
772
773 .RE
774 .B Description:
775 .RS 3
776 This command allows the user to set up a mask which will be used during
777 recursive operation of the
778 .B mget
779 and
780 .B mput
781 commands.
782
783 The masks specified to the
784 .B mget
785 and
786 .B mput
787 commands act as filters for directories
788 rather than files when recursion is toggled ON.
789
790 The mask specified with the
791 .B mask
792 command is necessary to filter files within those directories. For example,
793 if the mask specified in an
794 .B mget
795 command is "source*"
796 .I and
797 the mask specified with the
798 .B mask
799 command is "*.c"
800 .I and
801 recursion is toggled ON, the
802 .B mget
803 command will retrieve all files matching "*.c" in all directories below
804 and including all directories matching "source*" in the current working 
805 directory.
806
807 Note that the value for
808 .I mask
809 defaults to blank (equivalent to "*") and remains so until the
810 .B mask
811 command is used to change it. It retains the most recently specified value
812 indefinitely. To avoid unexpected results it would be wise to change the
813 value of
814 .I mask
815 back to "*" after using the
816 .B mget
817 or
818 .B mput
819 commands.
820 .RE
821 .RE
822
823 .B md
824 .RS 3
825 .B Parameters:
826 .RS 3
827 .I <directory name>
828
829 .RE
830 .B Description:
831 .RS 3
832 See the
833 .B mkdir
834 command.
835 .RE
836 .RE
837
838 .B mget
839 .RS 3
840 .B Parameters:
841 .RS 3
842 .I <mask>
843
844 .RE
845 .B Description:
846 .RS 3
847 Copy all files matching
848 .I mask
849 from the server to the machine running the client.
850
851 Note that
852 .I mask
853 is interpreted differently during recursive operation and non-recursive
854 operation - refer to the
855 .B recurse
856 and
857 .B mask
858 commands for more information. Note that all transfers in
859 .B smbclient
860 are binary. See also the
861 .B lowercase
862 command.
863 .RE
864 .RE
865
866 .B mkdir
867 .RS 3
868 .B Parameters:
869 .RS 3
870 .I <directory name>
871
872 .RE
873 .B Description:
874 .RS 3
875 Create a new directory 
876 .B on the server
877 (user access privileges permitting) with the specified name.
878 .RE
879 .RE
880
881 .B mput
882 .RS 3
883 .B Parameters:
884 .RS 3
885 .I <mask>
886
887 .RE
888 .B Description:
889 .RS 3
890 Copy all files matching
891 .I mask
892 in the current working directory
893 .B on the local machine
894 to the current working directory on the server.
895
896 Note that
897 .I mask
898 is interpreted differently during recursive operation and non-recursive
899 operation - refer to the
900 .B recurse
901 and
902 .B mask
903 commands for more information. Note that all transfers in
904 .B smbclient
905 are binary.
906 .RE
907 .RE
908
909 .B print
910 .RS 3
911 .B Parameters:
912 .RS 3
913 .I <file name>
914
915 .RE
916 .B Description:
917 .RS 3
918 Print the specified file
919 .B from the local machine
920 through a printable service on the server.
921
922 See also the
923 .B printmode
924 command.
925 .RE
926 .RE
927
928 .B printmode
929 .RS 3
930 .B Parameters:
931 .RS 3
932 .I <graphics or text>
933
934 .RE
935 .B Description:
936 .RS 3
937 Set the print mode to suit either binary data (such as graphical information)
938 or text. Subsequent
939 .B print
940 commands will use the currently set print mode.
941 .RE
942 .RE
943
944 .B prompt
945 .RS 3
946 .B Parameters:
947 .RS 3
948 None.
949
950 .RE
951 .B Description:
952 .RS 3
953 Toggle prompting for filenames during operation of the
954 .B mget
955 and
956 .B mput
957 commands.
958
959 When toggled ON, the user will be prompted to confirm the transfer of each
960 file during these commands. When toggled OFF, all specified files will be
961 transferred without prompting.
962 .RE
963 .RE
964
965 .B put
966 .RS 3
967 .B Parameters:
968 .RS 3
969 .I <local file name> [remote file name]
970
971 .RE
972 .B Description:
973 .RS 3
974 Copy the file called
975 .I local file name
976 from the machine running the client to the server. If specified, name the
977 remote copy
978 .I remote file name.
979 Note that all transfers in
980 .B smbclient
981 are binary. See also the
982 .B lowercase
983 command.
984 .RE
985 .RE
986
987 .B queue
988 .RS 3
989 .B Parameters:
990 .RS 3
991 None.
992
993 .RE
994 .B Description:
995 .RS 3
996 Displays the print queue, showing the job id, name, size and current status.
997 .RE
998 .RE
999
1000 .B quit
1001 .RS 3
1002 .B Parameters:
1003 .RS 3
1004 None.
1005
1006 .RE
1007 .B Description:
1008 .RS 3
1009 See the
1010 .B exit
1011 command.
1012 .RE
1013 .RE
1014
1015 .B rd
1016 .RS 3
1017 .B Parameters:
1018 .RS 3
1019 .I <directory name>
1020
1021 .RE
1022 .B Description:
1023 .RS 3
1024 See the
1025 .B rmdir
1026 command.
1027 .RE
1028 .RE
1029
1030 .B recurse
1031 .RS 3
1032 .B Parameters:
1033 .RS 3
1034 None.
1035
1036 .RE
1037 .B Description:
1038 .RS 3
1039 Toggle directory recursion for the commands
1040 .B mget
1041 and
1042 .BR mput .
1043
1044 When toggled ON, these commands will process all directories in the source
1045 directory (i.e., the directory they are copying
1046 .IR from )
1047 and will recurse into any that match the mask specified to the command. Only
1048 files that match the mask specified using the
1049 .B mask
1050 command will be retrieved. See also the
1051 .B mask
1052 command.
1053
1054 When recursion is toggled OFF, only files from the current working
1055 directory on the source machine that match the mask specified to the
1056 .B mget
1057 or
1058 .B mput
1059 commands will be copied, and any mask specified using the
1060 .B mask
1061 command will be ignored.
1062 .RE
1063 .RE
1064
1065 .B rm
1066 .RS 3
1067 .B Parameters:
1068 .RS 3
1069 .I <mask>
1070
1071 .RE
1072 .B Description:
1073 .RS 3
1074 Remove all files matching
1075 .I mask
1076 from the current working directory
1077 .B on the server.
1078 .RE
1079 .RE
1080
1081 .B rmdir
1082 .RS 3
1083 .B Parameters:
1084 .RS 3
1085 .I <directory name>
1086
1087 .RE
1088 .B Description:
1089 .RS 3
1090 Remove the specified directory (user access privileges permitting)
1091 .B from the server.
1092 .RE
1093 .RE
1094
1095 .B tar
1096 .RS 3
1097 .B Parameters:
1098 .RS 3
1099 .I <c|x>[IXbgNa]
1100
1101 .RE
1102 .B Description:
1103 .RS 3
1104 Performs a tar operation - see the
1105 .B \-T
1106 command line option above. Behaviour
1107 may be affected by the
1108 .B tarmode
1109 command (see below). Using g (incremental) and N (newer) will affect
1110 tarmode settings. Note that using the "\-" option with tar x may not
1111 work - use the command line option instead.
1112 .RE
1113 .RE
1114
1115 .B blocksize
1116 .RS 3
1117 .B Parameters
1118 .RS 3
1119 .I <blocksize>
1120
1121 .RE
1122 .B Description
1123 .RS 3
1124 Blocksize. Must be followed by a valid (greater than zero) blocksize.
1125 Causes tar file to be written out in blocksize*TBLOCK (usually 512 byte)
1126 blocks.
1127 .RE
1128 .RE
1129
1130 .B tarmode
1131 .RS 3
1132 .B Parameters
1133 .RS 3
1134 .I <full|inc|reset|noreset>
1135
1136 .RE
1137 .B Description
1138 .RS 3
1139 Changes tar's behaviour with regard to archive bits. In full mode,
1140 tar will back up everything regardless of the archive bit setting (this
1141 is the default mode). In incremental mode, tar will only back up files
1142 with the archive bit set. In reset mode, tar will reset the archive bit
1143 on all files it backs up (implies read/write share).
1144 .RE
1145 .RE
1146
1147 .B setmode
1148 .RS 3
1149 .B Parameters
1150 .RS 3
1151 .I <filename> <perm=[+|\-]rsha>
1152
1153 .RE
1154 .B Description
1155 .RS 3
1156 A version of the DOS attrib command to set file permissions. For example,
1157
1158 setmode myfile +r
1159
1160 would make myfile read only.
1161 .RE
1162 .RE
1163 .SH NOTES
1164 Some servers are fussy about the case of supplied usernames, passwords, share
1165 names (aka service names) and machine names. If you fail to connect try
1166 giving all parameters in uppercase.
1167
1168 It is often necessary to use the
1169 .B \-n
1170 option when connecting to some types
1171 of servers. For example OS/2 LanManager insists on a valid NetBIOS name
1172 being used, so you need to supply a valid name that would be known to
1173 the server.
1174
1175 .B smbclient
1176 supports long file names where the server supports the LANMAN2
1177 protocol.
1178 .SH FILES
1179 Not applicable.
1180 .SH ENVIRONMENT VARIABLES
1181 .B USER
1182 .RS 3
1183 The variable USER may contain the username of the person using the client.
1184 This information is used only if the protocol level is high enough to support
1185 session-level passwords.
1186 .RE
1187 .SH INSTALLATION
1188 The location of the client program is a matter for individual system 
1189 administrators. The following are thus suggestions only.
1190
1191 It is recommended that the client software be installed under the
1192 /usr/local/samba
1193 hierarchy, in a directory readable by all, writeable only by root. The client
1194 program itself should be executable by all. The client should NOT be setuid 
1195 or setgid!
1196
1197 The client log files should be put in a directory readable and writable only
1198 by the user.
1199
1200 To test the client, you will need to know the name of a running Lan manager
1201 server. It is possible to run
1202 .B smbd
1203 (see
1204 .BR smbd (8))
1205 as an ordinary user - running that server as a daemon on a
1206 user-accessible port (typically any port number over 1024) would
1207 provide a suitable test server.
1208 .SH VERSION
1209 This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
1210 of the recent patches to it. These notes will necessarily lag behind 
1211 development of the client software, so it is possible that your version of 
1212 the client has extensions or parameter semantics that differ from or are not 
1213 covered by this man page. Please notify these to the address below for 
1214 rectification.
1215 .SH SEE ALSO
1216 .BR smbd (8)
1217 .SH DIAGNOSTICS
1218 [This section under construction]
1219
1220 Most diagnostics issued by the client are logged in a specified log file. The
1221 log file name is specified at compile time, but may be overridden on the
1222 command line.
1223
1224 The number and nature of diagnostics available depends on the debug level used
1225 by the client. If you have problems, set the debug level to 3 and peruse the
1226 log files.
1227
1228 Most messages are reasonably self-explanatory. Unfortunately, at time of
1229 creation of this man page the source code is still too fluid to warrant
1230 describing each and every diagnostic. At this stage your best bet is still
1231 to grep the source code and inspect the conditions that gave rise to the 
1232 diagnostics you are seeing.
1233 .SH BUGS
1234 None known.
1235 .SH CREDITS
1236 The original Samba software and related utilities were created by 
1237 Andrew Tridgell (samba-bugs@samba.anu.edu.au). Andrew is also the Keeper
1238 of the Source for this project.
1239
1240 See
1241 .BR smb.conf (5)
1242 for a full list of contributors and details on how to 
1243 submit bug reports, comments etc.