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