|Developer(s)||DEC, Intel, Digital Research, MetaComCo, Microware, Hewlett-Packard, Microsoft, IBM, ReactOS Contributors|
|Operating system||RT-11, RSX-11, OS/8, ISIS-II, TOPS-10, TOPS-20, OpenVMS, TRIPOS, DOS, OS-9, FlexOS, 4690 OS, MPE/iX, OS/2, Microsoft Windows, ReactOS, SymbOS, DexOS|
Generally, the command copies files from one location to another. It is used to make copies of existing files, but can also be used to combine (concatenate) multiple files into target files. The destination defaults to the current working directory. If multiple source files are indicated, the destination must be a directory, or an error will result. The command can copy in text mode or binary mode; in text mode,
copy will stop when it reaches the EOF character; in binary mode, the files will be concatenated in their entirety, ignoring EOF characters.
Files may be copied to devices. For example,
copy file con outputs file to the screen console. Devices themselves may be copied to a destination file, for example,
copy con file takes the text typed into the console and puts it into FILE, stopping when EOF (Ctrl+Z) is typed.
The command is available in RT-11, RSX-11, OS/8, ISIS-II, TOPS-10, TOPS-20, OpenVMS, TRIPOS, OS-9, DOS, FlexOS, 4690 OS, MPE/iX, OS/2, Microsoft Windows, ReactOS, SymbOS and DexOS.
It is also available in the open-source MS-DOS emulator DOSBox. The equivalent Unix command is
cp, the CPM command is
PIP. A more advanced copy command is called
The command is analogous to the OpenVOS
Example for DOS
copy letter.txt [destination]
Files may be copied to device files (e.g.
copy letter.txt lpt1 sends the file to the printer on lpt1.
copy letter.txt con would output to stdout, like the
type command. Note that
copy page1.txt+page2.txt book.txt will concatenate the files and output them as
book.txt. Which is just like the
cat command). It can also copy files between different disk drives.
There are two command-line switches to modify the behaviour when concatenating files:
- Text mode - This copies the text content of the file, stopping when it reaches the EOF character.
copy /a doc1.txt + doc2.txt doc3.txt copy /a *.txt doc3.txt
- Binary mode - This concatenates files in their entirety, ignoring EOF characters.
copy /b image1.jpg + image2.jpg image3.jpg
- XCOPY in DOS, OS/2, Windows etc.
- cp (Unix command)
- PIP (CP/M command) (Peripheral Interchange Program)
- Microsoft TechNet Copy article
- "Concise Command Language" (CCL)."OS/8 Handbook" (PDF). April 1974. Retrieved 28 November 2017.
- ISIS II Users Guide
- TOPS-10 Operating System Commands Manual (pdf). Digital Equipment Corporation. August 1980. Retrieved 17 February 2019.
- "TOPS-20 Command manual" (PDF).
- Paul S. Dayan (1992). The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. ISBN 0-9519228-0-7.
- MPE/iX Command Reference Manual