copy (command)
In computing, copy
is a command in RT-11, RSX-11, OS/8[1], TOPS-20[2], OpenVMS, TRIPOS[3], DOS, FlexOS[4], OS/2, Microsoft Windows and ReactOS operating systems. The command copies computer files from one directory to another.[5][6] The destination defaults to the current working directory. If more than one source file is indicated, the destination must be a directory.
It is also available in the open source MS-DOS emulator DOSBox. The equivalent Unix command is cp
. A more advanced copy command is called xcopy
.
The command is analogous to the OpenVOS copy_file
command.[7]
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
- Binary mode - This concatenates files in their entirety, ignoring EOF characters.
copy /b image1.jpg + image2.jpg image3.jpg
See also
- XCOPY in DOS, OS/2, Windows etc.
- cp (Unix command)
- PIP (CP/M command) (Peripheral Interchange Program)
References
- ↑ "Concise Command Language" (CCL)."OS/8 Handbook" (PDF). April 1974. Retrieved 28 November 2017.
- ↑ "TOPS-20 Command manual" (PDF).
- ↑ https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf
- ↑ http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf
- ↑ Microsoft TechNet Copy article
- ↑ https://archive.org/details/1988-rugheimer-spanik-amigados-quick-reference
- ↑ http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf