Linux 版 (精华区)
发信人: tcpip (高级草包), 信区: Linux
标 题: smbclient (1)--b
发信站: 紫 丁 香 (Fri May 5 20:09:26 2000) WWW-POST
-t terminal code
This option tells smbclient how to interpret filenames coming from the remote
server. Usually Asian language multibyte UNIX implementations use different
character sets than SMB/CIFS servers (EUC instead of SJIS for example).
Setting this parameter will let smbclient convert between the UNIX filenames
and the SMB filenames correctly. This option has not been seriously tested
and may have some problems.
用这个选项告诉smbclient怎样解释从远程服务器上传来的文件名。通常,unix系统对亚
洲多字节的语言会比SMB/CIFS服务器执行不同的字符集设置(例如用EUC代替SJIS)。设置
这个参数可以让smbclient在unix文件名与SMB文件名之间进行正确的转换。不过,这个选
项还没有经过严格的测试,所以可能会有些问题。
The terminal codes include sjis, euc, jis7, jis8, junet, hex, cap. This is
not a complete list, check the Samba source code for the complete list.
终端编码包含sjis, euc, jis7, jis8, junet, hex, cap。当然这些列表并不完整,要获
取完整列表请查看samba源编码。
-m max protocol level
With the new code in Samba2.0, smbclient always attempts to connect at the
maximum protocols level the server supports. This parameter is preserved for
backwards compatibility, but any string following the -m will be ignored.
作为samba 2.0的新功能,smbclient总是尝试以最高的协议等级来联接服务器。这个参数
就是用来保持向后兼容,但是任何紧跟在-m后的字串都会被忽略。
-b buffersize
This 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.
在对服务器进行上/下传文件时可以用这个选项来改变传输缓冲大小。默认值当然是65520
个字节。当从一个Win9x的服务器上进行文件传输时,把这个值设为稍小一点的值(例如
1200字节)可以看到有显示的速度提升。
-W WORKGROUP
Override the default workgroup specified in the workgroup parameter of the
smb.conf file for this connection. This may be needed to connect to some
servers.
我们用这个选项可以在对此次联接操作时,越过在smb.conf配置文件中workgroup参数指
定的默认工作组设定。当然这可能会需要对一些服务器进行联接。
-T tar options
smbclient may be used to create tar (1) compatible backups of all the files
on an SMB/CIFS share. The secondary tar flags that can be given to this
option are :
我们可以用smbclient来对位于SMB/CIFS共享资源上的所有文件建立兼容tar (1)格式的备
份。这些要使用的tar选项可以是以下这些:
c
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 x flag.
c
在unix系统上建立一个tar文件。当然了,卷文件名,目标设备都必须给出,或者用"-"代
表标准输出。如果用标准输出,你必须把记录等级调到它的最低值-d0以避免影响产生的
tar文件。这个标志的功能正好与x标志相反。
x
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 c flag. 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.
x
用这个标志可以把本地的一个tar备份文件释放(恢复)到共享资源上。除非使用了-D选项
,tar备份文件将从共享资源的顶层开始恢复。当然了,使用这个参数时后面必须紧跟一
个想要恢复的文件名,设备,或者用"-"代表标准输入。与上面一样,这个标志的功能正
好与c标志的功能相反。恢复后文件的建立时间(mtime)会被tar文件中保存的日期来替换
。而通常目录是无法做到这一点的。
I
Include files and directories. Is the default behavior when filenames are
specified above. Causes tar 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 r below.
I
用这个标志可以包含文件和目录。当在用-T参数时指定了一个文件名的话这就是默认的操
作了。在释放或建立时tar文件都会包含这些内容。参见下面的示例。
X
Exclude files and directories. Causes tar files to be excluded from an
extract or create. See example below. Filename globbing works in one of two
ways now. See r below.
X
排除文件和目录。在释放或者建立备份时使这些文件或目录不被包含在内。请看下面的示
例。
b
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.
b
块大小。在这个标志后必须用一个合法的块大小。使建立备份时写入到块大小*TBLOCK(通
常是512字节)这样大小的块中。
g
Incremental. Only back up files that have the archive bit set. Useful only
with the c flag.
g
增量备份。只备份设置了归档位的文件。必须与c标志一起使用。
q
Quiet. Keeps tar from printing diagnostics as it works. This is the same as
tarmode quiet.
q
静态工作。当操作进行时只打印出相应的诊断信息。它的意义与tar相应的静态工作模式
一样。
r
Regular expression include or exclude. Uses regular 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 ?.
r
用通常的表示形式来描述包含或排除操作。当用HAVE_REGEX_H编译的话,用通常的表达式
可以描述排除操作及要排除的文件,但是这种模式工作非常慢。如果没有用HAVE_REGEX_H
的话,可以用通配符*和?。
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.
N
要比较一个文件与之建立时的时间的话可以用这个标志。只有时间较新的文件会被备份到
tar文件中。当然必须与c标志一起使用。
a
Set archive bit. Causes the archive bit to be reset when a file is backed up.
Useful with the g and c flags.
a
设定归档位。使用这个标志在备份时对文件设置归档位。必须与g和c标志一起用。
Tar Long File Names
Tar 长文件名
smbclient'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, smbclient's tar option places all
files in the archive with relative names, not absolute names.
smbclient的tar选项现在可以在备份与恢复操作时支持长文件名了。但是,文件的完整路
径描述必须小于1024个字节。而且,当建立了一个归档包时,smbclient的tar选面会用文
件相关的名称写入归档包中,而不是绝对名称。
Tar Filenames
Tar 文件名
All file names can be given as DOS path names (with \ as the component
separator) or as UNIX path names (with / as the component separator).
所有的文件名都要以DOS路径名(以\作分隔符)或UNIX路径名(以/作分隔符)给出。
Examples
示例
Restore from tar file backup.tar into myshare on mypc (no password on
share).
把备份文件backup.tar恢复到位于mypc上的myshare中(无须口令)
smbclient //mypc/myshare "" -N -Tx backup.tar
Restore everything except users/docs
恢复除了users/docs以外的所有内容
smbclient //mypc/myshare "" -N -TXx backup.tar users/docs
Create a tar file of the files beneath users/docs.
在users/docs下建立一个备份文件
smbclient //mypc/myshare "" -N -Tc backup.tar users/docs
Create the same tar file as above, but now use a DOS path name.
与上面操作相同,不过用的是DOS路径名
smbclient //mypc/myshare "" -N -tc backup.tar users\edocs
Create a tar file of all the files and directories in the share.
对共享资源上所有内容作一完整的备份
smbclient //mypc/myshare "" -N -Tc backup.tar *
-D initial directory
Change to initial directory before starting. Probably only of any use with
the tar -T option.
在开始前用这个参数来改变初始目录。可能只在用tar的-T选项才用。
-c command string
command string is a semicolon separated list of commands to be executed
instead of prompting from stdin. -N is implied by -c.
This is particularly useful in scripts and for printing stdin to the server,
e.g. -c 'print
-'.
命令串是一个以'号分隔的用来替换标准输入提示的一系列命令列表,当然这个参数会包
含-N。当使用脚本或者要打印标准输入信息到服务器时这个选项就非常有用了,例如:
-c 'print -'
OPERATIONS
具体操作
Once the client is running, the user is presented with a prompt :
一旦运行了这个命令,就会在用户的提示行出现以下信息:
smb:\>
The backslash ("\") 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
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.
提示符表示用户准备好并等待执行一个用户命令。每个命令都是一个单独的词,一般随后
可以有选择地指定一些命令所需的参数。命令和参数之间用空格来分隔,除非有其它规定
。当然所有命令都区分大小写,而参数可能不一定要区分大小写,不过这应该由命令来决
定。
You can specify file names which have spaces in them by quoting the name with
double quotes, for example "a long file name".
要在文件名中使用空格的话必须用双引号封闭,例如:"a long file name"。
Parameters 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.
以方括号[]封闭的参数是可选项,如果没有使用,命令还是以默认的情况执行;而以尖括
号<>封闭的参数就是必须的了。
Note 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.
注意,所有对服务器的命令操作实际上是完成的是向服务器发送一个请求。因而,这种动
作可能在服务器到服务器之间会作些改变,这由服务器的实现方式来决定。
The commands available are given here in alphabetical order.
下面以字母次序给出可以使用的命令。
? [command]
If "command" is 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.
如果指定了"command",那么?命令就显示该"command"的一些简单介绍信息。如果单独使
用?的话,它会给出一份给用命令的列表。
! [shell command]
If "shell command" is 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.
如果指定了"shell command",那么!命令会执行一个本地的命令解释器并运行指定的
shell命令。如果不指定要运行哪个shell命令,那么就只执行一个本地命令解释器。
cd [directory name]
If "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.
如果指定了"directory name",那么服务器的当前工作路径就改为用户指定的路径。如果
指定了任何不可访问的目录的话,该操作就无效了。
If no directory name is specified, the current working directory on the
server will be reported.
如果不指定目录名,就向用户给出服务器当前工作路径。
del <mask>
The client will request that the server attempt to delete all files matching
"mask" from the current working directory on the server.
删除所有当前工作路径中匹配"mask"的文件。
dir <mask>
A list of the files matching "mask" in the current working directory on the
server will be retrieved from the server and displayed.
列出所有当前工作路径中匹配"mask"的文件。
exit
Terminate the connection with the server and exit from the program.
终止联接并退出程序。
get <remote file name> [local file name]
Copy the file called "remote file name" from the server to the machine
running the client. If specified, name the local copy "local file name". Note
that all transfers in smbclient are binary. See also the lowercase command.
把服务器上名为"remote file name"的文件到拷贝到本地,名称为"local file name"。
要注意的是,smbclient所用的传送模式为二进制模式。同时参见lowercase命令。
help [command]
See the ? command above.
同以上的?命令相同。
lcd [directory name]
If "directory name" is 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.
把本机目录改为"directory name"指定的地点。如果要换的目录是不可访问的话,操作将
会失败。
If no directory name is specified, the name of the current working directory
on the local machine will be reported.
如果不指定目录名,则显示当前本机的工作路径。
lowercase
Toggle lowercasing of filenames for the get and mget commands.
在get和mget命令中选用小写字符作为文件名。
When 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.
当选用了小写字符时,用get和mget命令时会把本地文件名都转换为小写。自然,当从服
务器上拷贝MSDOS文件时这个选项就非常有用了,因为小写文件名是unix系统的标准。
ls <mask>
See the dir command above.
同以上的dir命令。
mask <mask>
This command allows the user to set up a mask which will be used during
recursive operation of the mget and mput commands.
此命令允许用户设置在mget和mput命令的递归形式操作中使用的一个掩码(通配符)。
The masks specified to the mget and mput commands act as filters for
directories rather than files when recursion is toggled ON.
mget和mput命令指定这个掩码(通配符)作为目录过滤器。
The mask specified with the .B mask command is necessary to filter files
within those directories. For example, if the mask specified in an mget
command is "source*" and the mask specified with the mask command is "*.c"
and recursion is toggled ON, the mget command will retrieve all files
matching "*.c" in all directories below and including all directories
matching "source*" in the current working directory.
掩码(通配符)以.B形式指定,这个mask命令可以用那些目录方便地过滤文件。例如,如果
在mget命令中有"source*"部分,并且用mask命令指定了象"*.c"这样的掩码(通配符)以递
归形式来调用的话,mget命令会得到所有在当前工作目录中包含"source*"的目录以及其
下所有包含"*.c"的目录。
--
"这一千多年没写诗了?"
"写了, 不过只写了两句."
"千年得两句, 一定是万古丽句了. 念来听听."
"好吧, 我现丑了" 太白星清了清嗓子, 浑厚的男中音在天庭响起:
大海啊, 都是水;
骏马啊, 四条腿;
※ 来源:·紫 丁 香 bbs.hit.edu.cn·[FROM: freesrc.hit.edu]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:214.469毫秒