source: vendor/current/docs/manpages/smbclient.1@ 746

Last change on this file since 746 was 746, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated vendor to 3.6.9

File size: 39.6 KB
RevLine 
[594]1'\" t
[427]2.\" Title: smbclient
3.\" Author: [see the "AUTHOR" section]
[594]4.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
[746]5.\" Date: 10/29/2012
[427]6.\" Manual: User Commands
[740]7.\" Source: Samba 3.6
[427]8.\" Language: English
9.\"
[746]10.TH "SMBCLIENT" "1" "10/29/2012" "Samba 3\&.6" "User Commands"
[427]11.\" -----------------------------------------------------------------
12.\" * set default formatting
13.\" -----------------------------------------------------------------
14.\" disable hyphenation
15.nh
16.\" disable justification (adjust text to left margin only)
17.ad l
18.\" -----------------------------------------------------------------
19.\" * MAIN CONTENT STARTS HERE *
20.\" -----------------------------------------------------------------
[594]21.SH "NAME"
[427]22smbclient \- ftp\-like client to access SMB/CIFS resources on servers
[594]23.SH "SYNOPSIS"
[427]24.HP \w'\ 'u
[594]25smbclient [\-b\ <buffer\ size>] [\-d\ debuglevel] [\-e] [\-L\ <netbios\ name>] [\-U\ username] [\-I\ destinationIP] [\-M\ <netbios\ name>] [\-m\ maxprotocol] [\-A\ authfile] [\-N] [\-C] [\-g] [\-i\ scope] [\-O\ <socket\ options>] [\-p\ port] [\-R\ <name\ resolve\ order>] [\-s\ <smb\ config\ file>] [\-k] [\-P] [\-c\ <command>]
[427]26.HP \w'\ 'u
[594]27smbclient {servicename} [password] [\-b\ <buffer\ size>] [\-d\ debuglevel] [\-e] [\-D\ Directory] [\-U\ username] [\-W\ workgroup] [\-M\ <netbios\ name>] [\-m\ maxprotocol] [\-A\ authfile] [\-N] [\-C] [\-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]
[427]28.SH "DESCRIPTION"
29.PP
30This tool is part of the
31\fBsamba\fR(7)
32suite\&.
33.PP
[594]34smbclient
[427]35is a client that can \'talk\' to an SMB/CIFS server\&. It offers an interface similar to that of the ftp program (see
36\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\&.
37.SH "OPTIONS"
38.PP
39servicename
40.RS 4
41servicename is the name of the service you want to use on the server\&. A service name takes the form
[594]42//server/service
[427]43where
44\fIserver \fR
45is the NetBIOS name of the SMB/CIFS server offering the desired service and
46\fIservice\fR
47is the name of the service offered\&. Thus to connect to the service "printer" on the SMB/CIFS server "smbserver", you would use the servicename
[594]48//smbserver/printer
[427]49.sp
50Note 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\&.
51.sp
52The server name is looked up according to either the
53\fI\-R\fR
54parameter to
[594]55smbclient
[427]56or using the name resolve order parameter in the
57\fBsmb.conf\fR(5)
58file, allowing an administrator to change the order and methods by which server names are looked up\&.
59.RE
60.PP
61password
62.RS 4
63The password required to access the specified service on the specified server\&. If this parameter is supplied, the
64\fI\-N\fR
65option (suppress password prompt) is assumed\&.
66.sp
67There is no default password\&. If no password is supplied on the command line (either by using this parameter or adding a password to the
68\fI\-U\fR
69option (see below)) and the
70\fI\-N\fR
71option 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\&.)
72.sp
73Note: 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\&.
74.sp
75Be cautious about including passwords in scripts\&.
76.RE
77.PP
78\-R|\-\-name\-resolve <name resolve order>
79.RS 4
80This 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\&.
81.sp
82The options are :"lmhosts", "host", "wins" and "bcast"\&. They cause names to be resolved as follows:
83.sp
84.RS 4
85.ie n \{\
86\h'-04'\(bu\h'+03'\c
87.\}
88.el \{\
89.sp -1
90.IP \(bu 2.3
91.\}
92\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
93\fBlmhosts\fR(5)
94for details) then any name type matches for lookup\&.
95.RE
96.sp
97.RS 4
98.ie n \{\
99\h'-04'\(bu\h'+03'\c
100.\}
101.el \{\
102.sp -1
103.IP \(bu 2.3
104.\}
105\fBhost\fR: Do a standard host name to IP address resolution, using the system
[594]106/etc/hosts, 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
107/etc/nsswitch\&.conf
[427]108file)\&. Note that this method is only used if the NetBIOS name type being queried is the 0x20 (server) name type, otherwise it is ignored\&.
109.RE
110.sp
111.RS 4
112.ie n \{\
113\h'-04'\(bu\h'+03'\c
114.\}
115.el \{\
116.sp -1
117.IP \(bu 2.3
118.\}
119\fBwins\fR: Query a name with the IP address listed in the
120\fIwins server\fR
121parameter\&. If no WINS server has been specified this method will be ignored\&.
122.RE
123.sp
124.RS 4
125.ie n \{\
126\h'-04'\(bu\h'+03'\c
127.\}
128.el \{\
129.sp -1
130.IP \(bu 2.3
131.\}
132\fBbcast\fR: Do a broadcast on each of the known local interfaces listed in the
133\fIinterfaces\fR
134parameter\&. This is the least reliable of the name resolution methods as it depends on the target host being on a locally connected subnet\&.
[740]135.RE
[427]136.sp
137.RE
138If this parameter is not set then the name resolve order defined in the
139\fBsmb.conf\fR(5)
140file parameter (name resolve order) will be used\&.
141.sp
142The default order is lmhosts, host, wins, bcast and without this parameter or any entry in the
143\fIname resolve order \fR
144parameter of the
145\fBsmb.conf\fR(5)
146file the name resolution methods will be attempted in this order\&.
147.RE
148.PP
149\-M|\-\-message NetBIOS name
150.RS 4
151This 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\&.
152.sp
153If 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\&.
154.sp
155The message is also automatically truncated if the message is over 1600 bytes, as this is the limit of the protocol\&.
156.sp
157One useful trick is to pipe the message through
[594]158smbclient\&. For example: smbclient \-M FRED < mymessage\&.txt will send the message in the file
159mymessage\&.txt
[427]160to the machine FRED\&.
161.sp
162You may also find the
163\fI\-U\fR
164and
165\fI\-I\fR
166options useful, as they allow you to control the FROM and TO parts of the message\&.
167.sp
168See the
169\fImessage command\fR
170parameter in the
171\fBsmb.conf\fR(5)
172for a description of how to handle incoming WinPopup messages in Samba\&.
173.sp
174\fINote\fR: Copy WinPopup into the startup group on your WfWg PCs if you want them to always be able to receive messages\&.
175.RE
176.PP
177\-p|\-\-port port
178.RS 4
179This 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\&.
180.RE
181.PP
182\-g|\-\-grepable
183.RS 4
184This parameter provides combined with
185\fI\-L\fR
186easy parseable output that allows processing with utilities such as grep and cut\&.
187.RE
188.PP
189\-m|\-\-max\-protocol protocol
190.RS 4
191This parameter sets the maximum protocol version announced by the client\&.
192.RE
193.PP
[740]194\-P|\-\-machine\-pass
[427]195.RS 4
196Make queries to the external server using the machine account of the local server\&.
197.RE
198.PP
199\-h|\-\-help
200.RS 4
201Print a summary of command line options\&.
202.RE
203.PP
204\-I|\-\-ip\-address IP\-address
205.RS 4
206\fIIP address\fR
207is the address of the server to connect to\&. It should be specified in standard "a\&.b\&.c\&.d" notation\&.
208.sp
209Normally 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
210\fIname resolve order\fR
211parameter 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\&.
212.sp
213There is no default for this parameter\&. If not supplied, it will be determined automatically by the client as described above\&.
214.RE
215.PP
216\-E|\-\-stderr
217.RS 4
218This parameter causes the client to write messages to the standard error stream (stderr) rather than to the standard output stream\&.
219.sp
220By default, the client writes messages to standard output \- typically the user\'s tty\&.
221.RE
222.PP
223\-L|\-\-list
224.RS 4
225This option allows you to look at what services are available on a server\&. You use it as
[594]226smbclient \-L host
[427]227and a list should appear\&. The
228\fI\-I \fR
229option 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\&.
230.RE
231.PP
232\-b|\-\-send\-buffer buffersize
233.RS 4
234This 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\&.
235.RE
236.PP
[740]237\-e|\-\-encrypt
[427]238.RS 4
[746]239This 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 negotiation (either kerberos or NTLMv1/v2 if given domain/username/password triple\&. Fails the connection if encryption cannot be negotiated\&.
[427]240.RE
241.PP
242\-d|\-\-debuglevel=level
243.RS 4
244\fIlevel\fR
245is an integer from 0 to 10\&. The default value if this parameter is not specified is 1\&.
246.sp
247The 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\&.
248.sp
249Levels 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\&.
250.sp
251Note that specifying this parameter here will override the
252\m[blue]\fB\%smb.conf.5.html#\fR\m[]
253parameter in the
[594]254smb\&.conf
[427]255file\&.
256.RE
257.PP
258\-V|\-\-version
259.RS 4
260Prints the program version number\&.
261.RE
262.PP
263\-s|\-\-configfile <configuration file>
264.RS 4
265The 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
[594]266smb\&.conf
[427]267for more information\&. The default configuration file name is determined at compile time\&.
268.RE
269.PP
270\-l|\-\-log\-basename=logdirectory
271.RS 4
272Base directory name for log/debug files\&. The extension
273\fB"\&.progname"\fR
274will be appended (e\&.g\&. log\&.smbclient, log\&.smbd, etc\&.\&.\&.)\&. The log file is never removed by the client\&.
275.RE
276.PP
277\-N|\-\-no\-pass
278.RS 4
279If 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\&.
280.sp
281Unless a password is specified on the command line or this parameter is specified, the client will request a password\&.
282.sp
283If 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\&.
284.RE
285.PP
286\-k|\-\-kerberos
287.RS 4
288Try to authenticate with kerberos\&. Only useful in an Active Directory environment\&.
289.RE
290.PP
291\-C|\-\-use\-ccache
292.RS 4
293Try to use the credentials cached by winbind\&.
294.RE
295.PP
296\-A|\-\-authentication\-file=filename
297.RS 4
298This 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
299.sp
300.if n \{\
301.RS 4
302.\}
303.nf
304username = <value>
305password = <value>
306domain = <value>
307.fi
308.if n \{\
309.RE
310.\}
311.sp
312Make certain that the permissions on the file restrict access from unwanted users\&.
313.RE
314.PP
315\-U|\-\-user=username[%password]
316.RS 4
317Sets the SMB username or username and password\&.
318.sp
319If %password is not specified, the user will be prompted\&. The client will first check the
320\fBUSER\fR
321environment variable, then the
322\fBLOGNAME\fR
323variable and if either exists, the string is uppercased\&. If these environmental variables are not found, the username
324\fBGUEST\fR
325is used\&.
326.sp
327A 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
328\fI\-A\fR
329for more details\&.
330.sp
331Be cautious about including passwords in scripts\&. Also, on many systems the command line of a running process may be seen via the
[594]332ps
[427]333command\&. To be safe always allow
[594]334rpcclient
[427]335to prompt for a password and type it in directly\&.
336.RE
337.PP
338\-n|\-\-netbiosname <primary NetBIOS name>
339.RS 4
340This option allows you to override the NetBIOS name that Samba uses for itself\&. This is identical to setting the
341\m[blue]\fB\%smb.conf.5.html#\fR\m[]
342parameter in the
[594]343smb\&.conf
[427]344file\&. However, a command line setting will take precedence over settings in
[594]345smb\&.conf\&.
[427]346.RE
347.PP
348\-i|\-\-scope <scope>
349.RS 4
350This specifies a NetBIOS scope that
[594]351nmblookup
[427]352will 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
353\fIvery\fR
354rarely used, only set this parameter if you are the system administrator in charge of all the NetBIOS systems you communicate with\&.
355.RE
356.PP
357\-W|\-\-workgroup=domain
358.RS 4
359Set 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)\&.
360.RE
361.PP
362\-O|\-\-socket\-options socket options
363.RS 4
364TCP socket options to set on the client socket\&. See the socket options parameter in the
[594]365smb\&.conf
[427]366manual page for the list of valid options\&.
367.RE
368.PP
369\-T|\-\-tar tar options
370.RS 4
371smbclient may be used to create
[594]372tar(1)
[427]373compatible backups of all the files on an SMB/CIFS share\&. The secondary tar flags that can be given to this option are :
374.sp
375.RS 4
376.ie n \{\
377\h'-04'\(bu\h'+03'\c
378.\}
379.el \{\
380.sp -1
381.IP \(bu 2.3
382.\}
383\fIc\fR
384\- 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
385\fIx\fR
386flag\&.
387.RE
388.sp
389.RS 4
390.ie n \{\
391\h'-04'\(bu\h'+03'\c
392.\}
393.el \{\
394.sp -1
395.IP \(bu 2.3
396.\}
397\fIx\fR
398\- 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
399\fIc\fR
400flag\&. 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\&.
401.RE
402.sp
403.RS 4
404.ie n \{\
405\h'-04'\(bu\h'+03'\c
406.\}
407.el \{\
408.sp -1
409.IP \(bu 2.3
410.\}
411\fII\fR
412\- 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
413\fIr\fR
414below\&.
415.RE
416.sp
417.RS 4
418.ie n \{\
419\h'-04'\(bu\h'+03'\c
420.\}
421.el \{\
422.sp -1
423.IP \(bu 2.3
424.\}
425\fIX\fR
426\- 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
427\fIr\fR
428below\&.
429.RE
430.sp
431.RS 4
432.ie n \{\
433\h'-04'\(bu\h'+03'\c
434.\}
435.el \{\
436.sp -1
437.IP \(bu 2.3
438.\}
439\fIF\fR
440\- File containing a list of files and directories\&. The
441\fIF\fR
442causes 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
443\fIr\fR
444below\&.
445.RE
446.sp
447.RS 4
448.ie n \{\
449\h'-04'\(bu\h'+03'\c
450.\}
451.el \{\
452.sp -1
453.IP \(bu 2.3
454.\}
455\fIb\fR
456\- 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\&.
457.RE
458.sp
459.RS 4
460.ie n \{\
461\h'-04'\(bu\h'+03'\c
462.\}
463.el \{\
464.sp -1
465.IP \(bu 2.3
466.\}
467\fIg\fR
468\- Incremental\&. Only back up files that have the archive bit set\&. Useful only with the
469\fIc\fR
470flag\&.
471.RE
472.sp
473.RS 4
474.ie n \{\
475\h'-04'\(bu\h'+03'\c
476.\}
477.el \{\
478.sp -1
479.IP \(bu 2.3
480.\}
481\fIq\fR
482\- Quiet\&. Keeps tar from printing diagnostics as it works\&. This is the same as tarmode quiet\&.
483.RE
484.sp
485.RS 4
486.ie n \{\
487\h'-04'\(bu\h'+03'\c
488.\}
489.el \{\
490.sp -1
491.IP \(bu 2.3
492.\}
493\fIr\fR
494\- 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 \'?\'\&.
495.RE
496.sp
497.RS 4
498.ie n \{\
499\h'-04'\(bu\h'+03'\c
500.\}
501.el \{\
502.sp -1
503.IP \(bu 2.3
504.\}
505\fIN\fR
506\- 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
507\fIc\fR
508flag\&.
509.RE
510.sp
511.RS 4
512.ie n \{\
513\h'-04'\(bu\h'+03'\c
514.\}
515.el \{\
516.sp -1
517.IP \(bu 2.3
518.\}
519\fIa\fR
520\- Set archive bit\&. Causes the archive bit to be reset when a file is backed up\&. Useful with the
521\fIg\fR
522and
523\fIc\fR
524flags\&.
[740]525.RE
[427]526.sp
527.RE
528\fITar Long File Names\fR
529.sp
[594]530smbclient\'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,
531smbclient\'s tar option places all files in the archive with relative names, not absolute names\&.
[427]532.sp
533\fITar Filenames\fR
534.sp
535All 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)\&.
536.sp
537\fIExamples\fR
538.sp
539Restore from tar file
[594]540backup\&.tar
[427]541into myshare on mypc (no password on share)\&.
542.sp
[746]543smbclient //mypc/myshare "" \-N \-Tx backup\&.tar
[427]544.sp
545Restore everything except
[594]546users/docs
[427]547.sp
[594]548smbclient //mypc/myshare "" \-N \-TXx backup\&.tar users/docs
[427]549.sp
550Create a tar file of the files beneath
[594]551users/docs\&.
[427]552.sp
[594]553smbclient //mypc/myshare "" \-N \-Tc backup\&.tar users/docs
[427]554.sp
555Create the same tar file as above, but now use a DOS path name\&.
556.sp
[594]557smbclient //mypc/myshare "" \-N \-tc backup\&.tar users\eedocs
[427]558.sp
559Create a tar file of the files listed in the file
[594]560tarlist\&.
[427]561.sp
[594]562smbclient //mypc/myshare "" \-N \-TcF backup\&.tar tarlist
[427]563.sp
564Create a tar file of all the files and directories in the share\&.
565.sp
[594]566smbclient //mypc/myshare "" \-N \-Tc backup\&.tar *
[427]567.RE
568.PP
569\-D|\-\-directory initial directory
570.RS 4
571Change to initial directory before starting\&. Probably only of any use with the tar \-T option\&.
572.RE
573.PP
[740]574\-c|\-\-command command string
[427]575.RS 4
576command string is a semicolon\-separated list of commands to be executed instead of prompting from stdin\&.
577\fI \-N\fR
578is implied by
579\fI\-c\fR\&.
580.sp
581This is particularly useful in scripts and for printing stdin to the server, e\&.g\&.
[594]582\-c \'print \-\'\&.
[427]583.RE
584.SH "OPERATIONS"
585.PP
586Once the client is running, the user is presented with a prompt :
587.PP
[594]588smb:\e>
[427]589.PP
590The backslash ("\e\e") indicates the current working directory on the server, and will change if the current working directory is changed\&.
591.PP
592The 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\&.
593.PP
594You can specify file names which have spaces in them by quoting the name with double quotes, for example "a long file name"\&.
595.PP
596Parameters 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\&.
597.PP
598Note 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\&.
599.PP
600The commands available are given here in alphabetical order\&.
601.PP
602? [command]
603.RS 4
604If
605\fIcommand\fR
606is 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\&.
607.RE
608.PP
609! [shell command]
610.RS 4
611If
612\fIshell command\fR
613is 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\&.
614.RE
615.PP
616allinfo file
617.RS 4
618The client will request that the server return all known information about a file or directory (including streams)\&.
619.RE
620.PP
621altname file
622.RS 4
623The client will request that the server return the "alternate" name (the 8\&.3 name) for a file or directory\&.
624.RE
625.PP
626archive <number>
627.RS 4
628Sets 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\&.
629.RE
630.PP
631blocksize <number>
632.RS 4
633Sets 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\&.
634.RE
635.PP
636cancel jobid0 [jobid1] \&.\&.\&. [jobidN]
637.RS 4
638The client will request that the server cancel the printjobs identified by the given numeric print job ids\&.
639.RE
640.PP
641case_sensitive
642.RS 4
643Toggles the setting of the flag in SMB packets that tells the server to treat filenames as case sensitive\&. Set to OFF by default (tells file server to treat filenames as case insensitive)\&. Only currently affects Samba 3\&.0\&.5 and above file servers with the case sensitive parameter set to auto in the smb\&.conf\&.
644.RE
645.PP
646cd <directory name>
647.RS 4
648If "directory name" is specified, the current working directory on the server will be changed to the directory specified\&. This operation will fail if for any reason the specified directory is inaccessible\&.
649.sp
650If no directory name is specified, the current working directory on the server will be reported\&.
651.RE
652.PP
653chmod file mode in octal
654.RS 4
655This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. The client requests that the server change the UNIX permissions to the given octal mode, in standard UNIX format\&.
656.RE
657.PP
658chown file uid gid
659.RS 4
660This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. The client requests that the server change the UNIX user and group ownership to the given decimal values\&. Note there is currently no way to remotely look up the UNIX uid and gid values for a given name\&. This may be addressed in future versions of the CIFS UNIX extensions\&.
661.RE
662.PP
663close <fileid>
664.RS 4
665Closes a file explicitly opened by the open command\&. Used for internal Samba testing purposes\&.
666.RE
667.PP
668del <mask>
669.RS 4
670The client will request that the server attempt to delete all files matching
671\fImask\fR
672from the current working directory on the server\&.
673.RE
674.PP
675dir <mask>
676.RS 4
677A list of the files matching
678\fImask\fR
679in the current working directory on the server will be retrieved from the server and displayed\&.
680.RE
681.PP
682du <filename>
683.RS 4
[746]684Does a directory listing and then prints out the current disk usage and free space on a share\&.
[427]685.RE
686.PP
687echo <number> <data>
688.RS 4
689Does an SMBecho request to ping the server\&. Used for internal Samba testing purposes\&.
690.RE
691.PP
692exit
693.RS 4
694Terminate the connection with the server and exit from the program\&.
695.RE
696.PP
697get <remote file name> [local file name]
698.RS 4
699Copy the file called
[594]700remote file name
[427]701from the server to the machine running the client\&. If specified, name the local copy
[594]702local file name\&. Note that all transfers in
703smbclient
[427]704are binary\&. See also the lowercase command\&.
705.RE
706.PP
707getfacl <filename>
708.RS 4
709Requires the server support the UNIX extensions\&. Requests and prints the POSIX ACL on a file\&.
710.RE
711.PP
712hardlink <src> <dest>
713.RS 4
714Creates a hardlink on the server using Windows CIFS semantics\&.
715.RE
716.PP
717help [command]
718.RS 4
719See the ? command above\&.
720.RE
721.PP
722history
723.RS 4
724Displays the command history\&.
725.RE
726.PP
727iosize <bytes>
728.RS 4
729When sending or receiving files, smbclient uses an internal memory buffer by default of size 64512 bytes\&. This command allows this size to be set to any range between 16384 (0x4000) bytes and 16776960 (0xFFFF00) bytes\&. Larger sizes may mean more efficient data transfer as smbclient will try and use the most efficient read and write calls for the connected server\&.
730.RE
731.PP
732lcd [directory name]
733.RS 4
734If
735\fIdirectory name\fR
736is specified, the current working directory on the local machine will be changed to the directory specified\&. This operation will fail if for any reason the specified directory is inaccessible\&.
737.sp
738If no directory name is specified, the name of the current working directory on the local machine will be reported\&.
739.RE
740.PP
741link target linkname
742.RS 4
743This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. The client requests that the server create a hard link between the linkname and target files\&. The linkname file must not exist\&.
744.RE
745.PP
746listconnect
747.RS 4
748Show the current connections held for DFS purposes\&.
749.RE
750.PP
751lock <filenum> <r|w> <hex\-start> <hex\-len>
752.RS 4
753This command depends on the server supporting the CIFS UNIX extensions and will fail if the server does not\&. Tries to set a POSIX fcntl lock of the given type on the given range\&. Used for internal Samba testing purposes\&.
754.RE
755.PP
756logon <username> <password>
757.RS 4
758Establishes a new vuid for this session by logging on again\&. Replaces the current vuid\&. Prints out the new vuid\&. Used for internal Samba testing purposes\&.
759.RE
760.PP
761lowercase
762.RS 4
763Toggle lowercasing of filenames for the get and mget commands\&.
764.sp
765When lowercasing is toggled ON, local filenames are converted to lowercase when using the get and mget commands\&. This is often useful when copying (say) MSDOS files from a server, because lowercase filenames are the norm on UNIX systems\&.
766.RE
767.PP
768ls <mask>
769.RS 4
770See the dir command above\&.