<code>copy</code> is a shell command for copying files.
Different implementations provide various capabilities, such as:
The command is available in RT-11, OS/8, RSX-11, ISIS-II, iRMX 86, TOPS-10, TOPS-20, OpenVMS, MetaComCo TRIPOS, HDOS, Z80-RIO, OS-9, DOS, FlexOS, 4690 OS, PC-MOS, HP MPE/iX, OS/2, Windows, ROM-DOS, ReactOS, SymbOS, DexOS, and 86-DOS.
Under IBM PC DOS/MS-DOS the command is available since version 1.
Some shells provide a copy command with a different name. In Unix-based systems, the copy command is <code>cp</code>. In CP/M, the command is <code>PIP</code>. in OpenVOS, the command is <code>copy_file</code>.
The following copies existing file fromfile to path tofile.
copy fromfile tofile
A file can be copied to a device. The following sends a file to the printer on lpt1.
copy letter.txt lpt1
The following outputs to stdout, like the <code>type</code> command.
copy letter.txt con
The following concatenates the page# files into <code>book.txt</code> like <code>cat</code>.
<code>copy page1.txt+page2.txt book.txt</code>
The command can copy files between drives.
The following uses text mode to copy text of the file, stopping when it reaches an EOF character.
copy /a doc1.txt + doc2.txt doc3.txt copy /a *.txt doc3.txt
The following uses binary mode, concatenating files in their entirety and ignoring EOF characters.
copy /b image1.jpg + image2.jpg image3.jpg