client.c: New print queue query code from Jeff C. Foster " <jfoste@wgc.woodward...
[jelmer/samba4.git] / docs / manpages / smbclient.1
index 5590e01296e14720d37b5dec97244d55a85e5b55..6ae454f2f24719e06a83b085f542efca6ca99c76 100644 (file)
@@ -1,4 +1,4 @@
-.TH SMBCLIENT 1 17/1/1995 smbclient smbclient
+.TH SMBCLIENT 1 smbclient smbclient
 .SH NAME
 smbclient \- ftp-like Lan Manager client program
 .SH SYNOPSIS
@@ -7,43 +7,51 @@ smbclient \- ftp-like Lan Manager client program
 [
 .B password
 ] [
-.B -A
+.B \-A
 ] [
-.B -E
+.B \-E
 ] [
-.B -L
+.B \-L
 .I host
 ] [
-.B -M
+.B \-M
 .I host
 ] [
-.B -I
+.B \-I
 .I IP number
 ] [
-.B -N
+.B \-N
 ] [
-.B -P
+.B \-P
 ] [
-.B -U
+.B \-U
 .I username
 ] [
-.B -d
+.B \-d
 .I debuglevel
 ] [
-.B -l
+.B \-l
 .I log basename
 ] [
-.B -n
+.B \-n
 .I netbios name
 ] [
-.B -O
+.B \-W
+.I workgroup
+] [
+.B \-O
 .I socket options
 ] [
-.B -p
+.B \-p
 .I port number
-.B -T
+] [
+.B \-c
+.I command string
+] [
+.B \-T
 .I tar options
-.B -D
+] [
+.B \-D
 .I initial directory
 ]
 .SH DESCRIPTION
@@ -54,17 +62,17 @@ is a client that can 'talk' to a Lan Manager server. It offers
 an interface similar to that of the 
 .B ftp
 program (see
-.B ftp(1)). Operations include things like getting files from the
+.BR ftp (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.
-
 .SH OPTIONS
 .B servicename
 .RS 3
 .B servicename
 is the name of the service you want to use on the server. A service
 name takes the form
-.B "\\\\\\\\server\\\\service"
+.B "\e\eserver\eservice"
 where
 .B server
 is the netbios name of the Lan Manager server offering the desired service and
@@ -73,7 +81,7 @@ is the name of the service offered. Thus to connect to the service "printer"
 on the Lan Manager server "lanman", you would use the servicename
 
 .RS 10
-.B "\\\\\\\\lanman\\\\printer"
+.B "\e\elanman\eprinter"
 .RE
 
 Note that the server name required is NOT necessarily the host name of the
@@ -87,16 +95,16 @@ be the same as the hostname of the machine running the server.
 password
 is the password required to access the specified service on the
 specified server. If supplied, the
-.B -N
+.B \-N
 option (suppress password prompt) is assumed.
 
 There is no default password. If no password is supplied on the command line
 (either here or using the 
-.B -U
+.B \-U
 option (see below)) and 
-.B -N
+.B \-N
 is not specified, the client will prompt for a password, even if the desired 
-service does not require one. (If prompted for a password and none is 
+service does not require one. (If no password is 
 required, simply press ENTER to provide a null password.)
 
 Note: Some servers (including OS/2 and Windows for Workgroups) insist
@@ -106,7 +114,7 @@ rejected by these servers.
 Be cautious about including passwords in scripts.
 .RE
 
-.B -A
+.B \-A
 
 .RS 3
 This parameter, if specified, causes the maximum debug level to be selected.
@@ -115,21 +123,23 @@ a security issue involved, as at the maximum debug level cleartext passwords
 may be written to some log files.
 .RE
 
-.B -L
+.B \-L
 
 .RS 3
 This option allows you to look at what services are available on a
 server. You use it as "smbclient -L host" and a list should appear.
-The -I option may be useful if your netbios names don't match your 
+The
+.B \-I
+option may be useful if your netbios names don't match your 
 tcp/ip host names or if you are trying to reach a host on another
 network. For example:
 
 smbclient -L ftp -I ftp.microsoft.com
 
-will list the shares available on microsofts public server.
+will list the shares available on Microsoft's public server.
 .RE
 
-.B -M
+.B \-M
 
 .RS 3
 This options allows you to send messages, using the "WinPopup"
@@ -143,22 +153,30 @@ message will be lost, and no error message will occur.
 The message is also automatically truncated if the message is over
 1600 bytes, as this is the limit of the protocol.
 
-One useful trick is to cat the message through smbclient. For example:
+One useful trick is to cat the message through
+.BR smbclient .
+For example:
 
 cat mymessage.txt | smbclient -M FRED
 
 will send the message in the file "mymessage.txt" to the machine FRED.
 
-You may also find the -U and -I options useful, as they allow you to
+You may also find the
+.B \-U
+and
+.B \-I
+options useful, as they allow you to
 control the FROM and TO parts of the message. 
 
-Samba currently has no way of receiving WinPopup messages.
+See the message command section of
+.BR smb.conf (5)
+for a description of how to handle incoming WinPopup messages in Samba.
 
 Note: Copy WinPopup into the startup group on your WfWg PCs if you
 want them to always be able to receive messages.
 .RE
 
-.B -E
+.B \-E
 
 .RS 3
 This parameter, if specified, causes the client to write messages to the
@@ -168,7 +186,7 @@ By default, the client writes messages to standard output - typically the
 user's tty.
 .RE
 
-.B -I
+.B \-I
 .I IP number
 
 .RS 3
@@ -185,7 +203,7 @@ There is no default for this parameter. If not supplied, it will be determined
 automatically by the client as described above.
 .RE
 
-.B -N
+.B \-N
 
 .RS 3
 If specified, this parameter suppresses the normal password prompt from the
@@ -196,14 +214,16 @@ Unless a password is specified on the command line or this parameter is
 specified, the client will request a password.
 .RE
 
-.B -O
+.B \-O
 .I socket options
-.RS 3
-
-See the socket options section of smb.conf(5) for details
 
+.RS 3
+See the socket options section of
+.BR smb.conf (5)
+for details.
 .RE
-.B -P
+
+.B \-P
 
 .RS 3
 If specified, the service requested will be connected to as a printer service
@@ -213,7 +233,7 @@ will not be applicable for such a connection.
 By default, services will be connected to as NON-printer services.
 .RE
 
-.B -U
+.B \-U
 .I username
 
 .RS 3
@@ -239,19 +259,19 @@ be empty.
 
 If the service you are connecting to requires a password, it can be supplied
 using the
-.B -U
+.B \-U
 option, by appending a percent symbol ("%") then the password to 
 .I username.
 For example, to attach to a service as user "fred" with password "secret", you
 would specify
-.B -U
+.B \-U
 .I fred%secret
 on the command line. Note that there are no spaces around the percent symbol.
 
 If you specify the password as part of
 .I username
 then the 
-.B -N
+.B \-N
 option (suppress password prompt) is assumed.
 
 If you specify the password as a parameter AND as part of
@@ -269,10 +289,10 @@ rejected by these servers.
 Be cautious about including passwords in scripts.
 .RE
 
-.B -d
+.B \-d
 .I debuglevel
-.RS 3
 
+.RS 3
 debuglevel is an integer from 0 to 5.
 
 The default value if this parameter is not specified is zero.
@@ -288,7 +308,7 @@ use only by developers and generate HUGE amounts of log data, most of which
 is extremely cryptic.
 .RE
 
-.B -l
+.B \-l
 .I log basename
 
 .RS 3
@@ -312,9 +332,8 @@ log.client.out (containing outbound transaction data)
 
 The log files generated are never removed by the client.
 .RE
-.RE
 
-.B -n
+.B \-n
 .I netbios name
 
 .RS 3
@@ -323,10 +342,18 @@ uppercase) as its netbios name. This parameter allows you to override
 the host name and use whatever netbios name you wish.
 .RE
 
-.B -p
-.I port number
+.B \-W
+.I workgroup
+
 .RS 3
+Override what workgroup is used for the connection. This may be needed
+to connect to some servers.
+.RE
 
+.B \-p
+.I port number
+
+.RS 3
 port number is a positive integer value.
 
 The default value if this parameter is not specified is 139.
@@ -336,15 +363,28 @@ the server. The standard (well-known) port number for the server is 139,
 hence the default.
 
 This parameter is not normally specified.
+.RE
 
-.B -T
+.B \-T
 .I tar options
-.RS3 
 
-where tar options are one or more of c,x,I,X,b,g,N or a; used as:
+.RS 3 
+where
+.I tar options
+consists of one or more of
+.BR c ,
+.BR x ,
+.BR I ,
+.BR X ,
+.BR b ,
+.BR g ,
+.BR N
+or
+.BR a ;
+used as:
 .LP
 smbclient 
-.B "\\\\\\\\server\\\\share"
+.B "\e\eserver\eshare"
 \-TcxIXbgNa
 [
 .IR blocksize
@@ -357,18 +397,25 @@ smbclient
 .IR filenames....
 ]
 
-.RS3
+.RS 3
 .B c
 Create a tar file on UNIX. Must be followed by the name of a tar file,
-tape device or "-" for standard output. (May be useful to set debugging
-low (-d0)) to avoid corrupting your tar file if using "-"). Mutually
-exclusive with the x flag.
+tape device or "\-" for standard output. (May be useful to set debugging
+low
+.RB ( -d0 ))
+to avoid corrupting your tar file if using "\-"). Mutually
+exclusive with the
+.B x
+flag.
 
 .B x
-Extract (restore) a local tar file back to a share. Unless the -D
+Extract (restore) a local tar file back to a share. Unless the
+.B \-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 c flag.
+the share. Must be followed by the name of the tar file, device or "\-"
+for standard input. Mutually exclusive with the
+.B c
+flag.
 
 .B I
 Include files and directories. Is the default behaviour when
@@ -389,49 +436,69 @@ blocks.
 
 .B g
 Incremental. Only back up files that have the archive bit set. Useful
-only with the c flag.
+only with the
+.B c
+flag.
 
 .B N
 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 c flag.
+only with the
+.B c
+flag.
 
 .B a
 Set archive bit. Causes the archive bit to be reset when a file is backed
-up. Useful with the g (and c) flags.
+up. Useful with the
+.B g
+(and
+.BR c )
+flags.
 .LP
 
 .B Examples
 
-smbclient \\\\mypc\\myshare "" -N -Tx backup.tar
+smbclient \e\emypc\emyshare "" -N -Tx backup.tar
 
 Restore from tar file backup.tar into myshare on mypc (no password on share).
 
-smbclient \\\\mypc\\myshare "" -N -TXx backup.tar users/docs
+smbclient \e\emypc\emyshare "" -N -TXx backup.tar users/docs
 
 Restore everything except users/docs
 
-smbclient \\\\mypc\\myshare "" -N -Tc backup.tar users/docs
+smbclient \e\emypc\emyshare "" -N -Tc backup.tar users/docs
 
 Create a tar file of the files beneath users/docs.
-
+.RE
 .RE
 
-.B -D
+.B \-D
 .I initial directory
 
-.RS3 
-
+.RS 3 
 Change to initial directory before starting. Probably only of any use
-with the tar (\-T) option.
+with the tar
+.RB ( \-T )
+option.
+.RE
 
+.B \-c
+.I command string
 
-.RE
+.RS 3
+command string is a semicolon separated list of commands to be
+executed instead of prompting from stdin.
+.B \-N
+is implied by
+.BR \-c .
 
+This is particularly useful in scripts and for printing stdin to
+the server, e.g. \-c 'print \-'.
+.RE
 .SH OPERATIONS
-Once the client is running, the user is presented with a prompt, "smb: \\>".
-The backslash ("\\") indicates the current working directory on the server,
+Once the client is running, the user is presented with a prompt, "smb: \e>".
+The backslash ("\e") indicates the current working directory on the server,
 and will change if the current working directory is changed.
 
 The prompt indicates that the client is ready and waiting to carry out a user
@@ -573,7 +640,9 @@ Copy the file called
 from the server to the machine running the client. If specified, name the
 local copy
 .I local file name.
-Note that all transfers in smbclient are binary. See also the
+Note that all transfers in
+.B smbclient
+are binary. See also the
 .B lowercase
 command.
 .RE
@@ -637,7 +706,7 @@ when using the
 and
 .B mget
 commands. This is often useful when copying (say) MSDOS files from a server,
-because lowercase filenames are the norm on Unix systems.
+because lowercase filenames are the norm on UNIX systems.
 .RE
 .RE
 
@@ -747,8 +816,9 @@ operation - refer to the
 .B recurse
 and
 .B mask
-commands for more information. Note that all transfers in smbclient are 
-binary. See also the
+commands for more information. Note that all transfers in
+.B smbclient
+are binary. See also the
 .B lowercase
 command.
 .RE
@@ -791,8 +861,9 @@ operation - refer to the
 .B recurse
 and
 .B mask
-commands for more information. Note that all transfers in smbclient are 
-binary.
+commands for more information. Note that all transfers in
+.B smbclient
+are binary.
 .RE
 .RE
 
@@ -866,7 +937,9 @@ Copy the file called
 from the machine running the client to the server. If specified, name the
 remote copy
 .I remote file name.
-Note that all transfers in smbclient are binary. See also the
+Note that all transfers in
+.B smbclient
+are binary. See also the
 .B lowercase
 command.
 .RE
@@ -927,17 +1000,16 @@ None.
 Toggle directory recursion for the commands
 .B mget
 and
-.B mput
-.
+.BR mput .
 
 When toggled ON, these commands will process all directories in the source
-directory (ie., the directory they are copying
-.I from
-and will recurse into any that match the mask specified to the command. Only
+directory (i.e., the directory they are copying
+.IR from )
+and will recurse into any that match the mask specified to the command. Only
 files that match the mask specified using the
 .B mask
 command will be retrieved. See also the
-.mask
+.mask
 command.
 
 When recursion is toggled OFF, only files from the current working
@@ -990,11 +1062,13 @@ Remove the specified directory (user access privileges permitting)
 .RE
 .B Description:
 .RS 3
-Performs a tar operation - see -T command line option above. Behaviour
+Performs a tar operation - see the
+.B \-T
+command line option above. Behaviour
 may be affected by the
 .B tarmode
-command (see below). Using the g (incremental) and N (newer) will affect
-tarmode settings. Note that using the "-" option with tar x may not
+command (see below). Using g (incremental) and N (newer) will affect
+tarmode settings. Note that using the "\-" option with tar x may not
 work - use the command line option instead.
 .RE
 .RE
@@ -1035,7 +1109,7 @@ on all files it backs up (implies read/write share).
 .RS 3
 .B Parameters
 .RS 3
-.I <filename> <perm=[+|-]rsha>
+.I <filename> <perm=[+|\-]rsha>
 
 .RE
 .B Description
@@ -1047,14 +1121,13 @@ setmode myfile +r
 would make myfile read only.
 .RE
 .RE
-
 .SH NOTES
 Some servers are fussy about the case of supplied usernames, passwords, share
 names (aka service names) and machine names. If you fail to connect try
 giving all parameters in uppercase.
 
 It is often necessary to use the
-.B -n
+.B \-n
 option when connecting to some types
 of servers. For example OS/2 LanManager insists on a valid netbios name
 being used, so you need to supply a valid name that would be known to
@@ -1063,10 +1136,8 @@ the server.
 .B smbclient
 supports long file names where the server supports the LANMAN2
 protocol.
-
 .SH FILES
 Not applicable.
-
 .SH ENVIRONMENT VARIABLES
 .B USER
 .RS 3
@@ -1074,12 +1145,12 @@ The variable USER may contain the username of the person using the client.
 This information is used only if the protocol level is high enough to support
 session-level passwords.
 .RE
-
 .SH INSTALLATION
 The location of the client program is a matter for individual system 
 administrators. The following are thus suggestions only.
 
-It is recommended that the client software be installed under the /usr/local
+It is recommended that the client software be installed under the
+/usr/local/samba
 hierarchy, in a directory readable by all, writeable only by root. The client
 program itself should be executable by all. The client should NOT be setuid 
 or setgid!
@@ -1088,8 +1159,11 @@ The client log files should be put in a directory readable and writable only
 by the user.
 
 To test the client, you will need to know the name of a running Lan manager
-server. It is possible to run the smbd (see
-.B smbd(8)) as an ordinary user - running that server as a daemon on a
+server. It is possible to run
+.B smbd
+(see
+.BR smbd (8))
+as an ordinary user - running that server as a daemon on a
 user-accessible port (typically any port number over 1024) would
 provide a suitable test server.
 .SH VERSION
@@ -1100,8 +1174,7 @@ the client has extensions or parameter semantics that differ from or are not
 covered by this man page. Please notify these to the address below for 
 rectification.
 .SH SEE ALSO
-.B smbd(8)
-
+.BR smbd (8)
 .SH DIAGNOSTICS
 [This section under construction]
 
@@ -1118,16 +1191,14 @@ creation of this man page the source code is still too fluid to warrant
 describing each and every diagnostic. At this stage your best bet is still
 to grep the source code and inspect the conditions that gave rise to the 
 diagnostics you are seeing.
-
 .SH BUGS
 None known.
 .SH CREDITS
 The original Samba software and related utilities were created by 
-Andrew Tridgell (samba-bugs@anu.edu.au). Andrew is also the Keeper
+Andrew Tridgell (samba-bugs@samba.anu.edu.au). Andrew is also the Keeper
 of the Source for this project.
 
-This man page written by Karl Auer (Karl.Auer@anu.edu.au)
-
 See
-.B smb.conf(5) for a full list of contributors and details on how to 
+.BR smb.conf (5)
+for a full list of contributors and details on how to 
 submit bug reports, comments etc.