- 帖子
- 40
- 积分
- 64
- 技术
- 1
- 捐助
- 0
- 注册时间
- 2012-11-7
|
[其他] 每天一文:命令行微软官网翻译。12.11.15更新
由于我权限不够暂时发在这里了 十分抱歉。
对翻译的质量和准确性 在这里不做任何保证,当然欢迎大家积极指认错误!翻译的准确与否自行辨认。
微软所有命令的解释官网:http://technet.microsoft.com/en-us/library/cc771080.aspx
已经发布的命令:
copy、
attrib:http://www.bathome.net/viewthread.php?tid=20043&page=1&extra=#pid120151
del:http://www.bathome.net/thread-20075-1-1.html
cd:http://www.bathome.net/viewthread.php?tid=20109&page=1&extra=#pid120352
format:http://www.bathome.net/viewthread.php?tid=20121&extra=
for:http://www.bathome.net/viewthread.php?tid=20156&page=1&extra=#pid120476
if:http://www.bathome.net/viewthread.php?tid=20204&extra=
如对发布的相关命令有任何疑问可以相关帖子下面留言,我会尽力解答!这个疑问包括在使用命令时产生的疑惑或对原文某命令参数不理解等。
copy:
推出: 4, 17, 2012
更新日期: 4, 17, 2012
应用于: Windows 8, Windows Server 2008, Windows Server 2012, Windows Vista
复制一个或多个文件从一个位置到另一个位置。.
例如如何使用这个命令查看: Examples.
语法
________________________________________
copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] <源文件> [/a | /b] [+<源文件> [/a | /b] [+ ...]] [<目的路径和文件> [/a | /b]]
参数
________________________________________
参数 描述
/d Allows the encrypted files being copied to be saved as decrypted files at the destination.
允许加密文件被复制保存为解密文件到目标目录
/v Verifies that new files are written correctly.
确认新的文件被正确的写入。
/n Uses a short file name, if available, when copying a file with a name longer than eight characters, or with a file name extension longer than three characters.
使用短文件名,如果是合适的。当复制一个文件名超过8个字符,或扩展名超过3个字符的文件时。
/y Suppresses prompting to confirm that you want to overwrite an existing destination file.
禁止提示符确认你是否想要覆盖已经存在的目标文件。
/-y Prompts you to confirm that you want to overwrite an existing destination file.
提示你确认是否想要覆盖已经存的目标文件。
/z Copies networked files in restartable mode.
在可重新启动模式中复制网络文件。
/a Indicates an ASCII text file.
表示一个ascii文本文件。
/b Indicates a binary file.
表示一个二进制文件。
<Source> Required. Specifies the location from which you want to copy a file or set of files. Source can consist of a drive letter and colon, a directory name, a file name, or a combination of these.
需要的,指定你想要复制或设定文件从哪个位置。来源可以由一个磁盘字母和冒号,一个目录名,一个文件名或以上的组合组成。
<Destination> Required. Specifies the location to which you want to copy a file or set of files. Destination can consist of a drive letter and colon, a directory name, a file name, or a combination of these.
需要的,指定你想要复制或设置文件到哪个位置。目标可以由一个磁盘字母和冒号,一个目录名,一个文件名或以上的组合组成。
/? Displays help at the command prompt.
在命令提示中显示帮助。
Remarks
备注
________________________________________
• You can copy an ASCII text file that uses an end-of-file character (CTRL+Z) to indicate the end of the file.
你可以复制一个ASCII文本文件它使用一个文件结束符(CTRL+Z)来表明文件的末尾。(copy con 0.txt)
• Using /a
使用 /a
When /a precedes or follows a list of files on the command line, it applies to all files listed until copy encounters /b. In this case, /b applies to the file preceding /b.
在命令行中当/a位在一系列文件之前或之后,他将应用于所有列出的文件直到copy遇到/b,这时,/b应用于/b之前的那个文件。
The effect of /a depends on its position in the command-line string.
/a的影响取决于他在命令行字符中的位置。
When /a follows Source, copy treats the file as an ASCII file and copies data that precedes the first end-of-file character (CTRL+Z).
当/a跟随一个源文件,copy命令把这个文件当作ascii文件并且复制文件结束符之前的所有数据。
When /a follows Destination, copy adds an end-of-file character (CTRL+Z) as the last character of the file.
当/a后跟随一个目的文件,copy命令会加上一个文件结束符作为这个文件的最后一个字符。
• Using /b
使用/b
/b directs the command interpreter to read the number of bytes specified by the file size in the directory./b is the default value for copy, unless copy combines files.
/b引导命令解释器在目录中读取文件字节数的大小。/b是copy的默认值除非copy合并文件。
When /b precedes or follows a list of files on the command line, it applies to all listed files until copy encounters /a. In this case, /a applies to the file preceding /a.
在命令行中当/b位在一系列文件之前或之后,他应用于所有列出的文件直到copy命令遇到/a,这时,/a应用于/a之前的那个文件。
The effect of /b depends on its position in the command–line string.
/b的影响取决于他在命令行字符中的位置。
When /b follows Source, copy copies the entire file, including any end-of-file character (CTRL+Z).
当/b跟随一个源文件,copy命令会复制整个文件,包括任何文件结束符(ctrl+z)
When /b follows Destination, copy does not add an end-of-file character (CTRL+Z).
当/b跟随一个目标文件,copy命令不会加命令结束符(ctrl+z)。
• Using /v
使用/v
If a write operation cannot be verified an error message appears. Although recording errors rarely occur with copy, you can use /v to verify that critical data has been correctly recorded. The /v command-line option also slows down the copy command, because each sector recorded on the disk must be checked.
如果写操作不能被确认会出现错误信息。即使记录错误很少在copy命令中发生,你可以用/v来确认关键数据已经被正确的记录。/v命令行选项同时会拖慢copy命令,因为磁盘上每个扇区的记录都会被检查。
• Using /y and /-y
使用/y和/-y
If /y is preset in the COPYCMD environment variable, you can override this setting by using /-y at the command line. By default, you are prompted when you replace this setting, unless the copy command is executed in a batch script.
如果/y已经预设值在copycmd的环境变量里,你可以在命令行中通过使用/-y覆盖这个设置。默认情况下,你重置此设置时系统会提示,除非copy命令正在一个脚本中运行。
• Appending files
附加文件
To append files, specify a single file for Destination, but multiple files for Source (use wildcard characters orFile1+File2+File3 format).
为了附加文件,确认一个单独文件为目标文件,多个文件为源文件(使用通配符或者文件1+文件2+文件3格式)。
• Using /z
使用/z
If the connection is lost during the copy phase (for example, if the server going offline breaks the connection), copy /z resumes after the connection is re-established. /z also displays the percentage of the copy operation that is completed for each file.
如果在copy阶段连接丢失(例如,如果服务器下线中断了连接),copy /z会在接重新可用时恢复连接。/z也可以显示每个文件复制的完成百分比。
• Copying to and from devices
复制文件到磁盘或从磁盘复制文件
You can substitute a device name for one or more occurrences of Source or Destination.
你可以把一个或多个出现的源文件或目的文件替换为设备名。
• Using or omitting /b when copying to a device
使用或忽略/b在复制到设备时。
When Destination is a device (for example, Com1 or Lpt1), /b copies data to the device in binary mode. In binary mode, copy /b copies all characters (including special characters such as CTRL+C, CTRL+S, CTRL+Z, and ENTER) to the device as data. However, if you omit /b, data is copied to the device in ASCII mode. In ASCII mode, special characters might cause files to combine during the copying process.
当目标是一个设备时(例如,com1或者lpt1)/b以二进制的模式复制数据到设备。在二进制模式中,copy /b以数据的形式复制所有的字符(包括特殊符号就像ctrl+c,ctrl+s,ctrl+z和enter)到设备。然而,如果你忽略/b,数据以ascii模式复制到设备。在ASCII模式下,在复制过程中特殊字符也许会引起文件的组合。
• Using the default destination file
使用默认目的文件
If you do not specify a destination file, a copy is created with the same name, modified date, and modified time as the original file. The new copy is stored in the current directory on the current drive. If the source file is on the current drive and in the current directory and you do not specify a different drive or directory for the destination file, the copy command stops and displays the following error message:
如果你不指认目的文件,复本将会创建和原文件相同的名字、修改日期和修改时间。新的副本将会保存在当前磁盘的当前目录中。如果你不指定一个不同的磁盘或目录为目的文件。
copy命令将会停止并显示以下的错误信息。
File cannot be copied onto itself
文件无法自我复制
0 File(s) copied
0个文件被复制
• Combining files
合并文件
If you specify more than one file in Source, copy combines them all into a single file using the file name specified in Destination. Copy assumes the combined files are ASCII files unless you use the /b option.
如果你指定不止一个文件作为源文件,copy会将所有的文件合并进一个单独的文件使用指定的目的文件名。Copy命令假设合并的文件是ascii文件除非你使用/b选项。
• Copying zero-length files
复制0字节文件
Copy does not copy files that are 0 bytes long. Use xcopy to copy these files.
Copy命令不复制0字节的文件,使用xcopy来复制这些文件。
• Changing the time and date of a file
改变文件的时间和日期
If you want to assign the current time and date to a file without modifying the file, use the following syntax:
如果你想要把当前日期写入文件并且不修改文件使用以下语法
• copy /b <Source> +,,
The commas indicate the omission of the Destination parameter.
逗号表明遗漏的目标文件参数
• Copying files in subdirectories
在子目录中复制文件
To copy all of a directory's files and subdirectories, use the xcopy command.
为了复制目录和子目录中所有的文件,使用xcopy命令。
• The copy command, with different parameters, is available from the Recovery Console.
带有不同参数的copy 命令同样适用于故障恢复控制台。
Examples
例子
________________________________________
To copy a file called Memo.doc to Letter.doc in the current drive and ensure that an end-of-file character (CTRL+Z) is at the end of the copied file, type:
为了复制一个叫做memo.doc的文件为letter.doc在当前目录中并且确保文件结束符在复制文件的结尾,输入:
copy memo.doc letter.doc /a
To copy a file named Robin.typ from the current drive and directory to an existing directory named Birds that is located on drive C, type:
为了复制一个叫做robin.typ的文件从当前磁盘目录到一个存在的目录名字叫birds的c盘的一个目录,输入:
copy robin.typ c:\birds
If the Birds directory does not exist, the file Robin.typ is copied into a file named Birds that is located in the root directory on the disk in drive C.
如果 Birds 目录不存在,Robin.typ 文件将被复制到驱动器 C 的磁盘根目录下名为 Birds 的文件中。
To combine Mar89.rpt, Apr89.rpt, and May89.rpt, which are located in the current directory, and place them in a file named Report (also in the current directory), type:
为了合并mar89.rpt,apr89.rpt,和may89.rpt,位于当前目录下的三个文件。并且防止他们在一个名字叫做report的文件里(同样也在当前目录中),输入:
copy mar89.rpt + apr89.rpt + may89.rpt Report
When you combine files, copy marks the destination file with the current date and time. If you omit Destination, the files are combined and stored under the name of the first file in the list. For example, to combine all files in Report when a file named Report already exists, type:
当你合并文件时,copy记录目标文件用当前的日期和时间。如果你忽略目标文件,文件会合并并储存以列表中第一个文件的名字,例如,为了合并所有文件在report当report文件已经存在的时候,输入:
copy report + mar89.rpt + apr89.rpt + may89.rpt
To combine all files in the current directory that have the.txt file name extension into a single file named Combined.doc, type:
为了合并所有当前目录下的txt文件到一个名为combined.doc,输入
copy *.txt Combined.doc
If you want to combine several binary files into one file by using wildcard characters, include /b. This prevents Windows from treating CTRL+Z as an end-of-file character. For example, type:
如果你想要合并几个二进制文件到一个文件通过使用通配符,插入/b,这将组织windows系统吧ctrl+z当作文件结束符。例如,输入:
copy /b *.exe Combined.exe
Caution
注意
If you combine binary files, the resulting file might be unusable due to internal formatting.
如果你合并二进制文件,结果可能导致合并的文件不可用由于内部格式。
In the following example, copy combines each file that has a .txt extension with its corresponding .ref file. The result is a file with the same file name but with a .doc extension. Copy combines File1.txt with File1.ref to form File1.doc, and then copy combines File2.txt with File2.ref to form File2.doc, and so on. For example, type:
在以下的例子中,copy命令合并了每个txt扩展的文件和与他对应的ref扩展名的文件。结果是生成一个相同的文件名但是以.doc为扩展名。Copy合并1.txt和1.ref组成1.doc,然后copy合并2.txt和2.ref组成2.doc,如此依次执行。例如输入:
copy *.txt + *.ref *.doc
To combine all files with the .txt extension, and then combine all files with the .ref extension into one file named Combined.doc, type:
为了合并所有的txt扩展文件然后合并所有的ref扩展文件为一个combined.doc文件,输入:
copy *.txt + *.ref Combined.doc
这么着其实很乱 我想上传附件奈何权限不够。无法上传 以后有时间再补吧。每天一个命令哦! |
|