copy (command)
This article needs additional citations for verification. (April 2008) |
In computing, copy
is a command in RT-11, RSX-11, OpenVMS, DOS, OS/2 and Microsoft Windows operating systems. The command copies files from one location to another. The destination defaults to the current directory. If multiple source files are indicated, the destination must be a directory, or an error will result. The equivalent Unix command is cp
.
Example
copy filespec [destination]
Files may be copied to devices (e.g. copy file lpt1
would send the file to the printer on lpt1. copy file con
would output to screen, which would be the same as type. Most useful to note that copy file.txt+file2.txt file_cat.txt
will concatenate the files and output them as file_cat.txt
. Which is just like the cat
command.
When using this command to concatenate files there are two switches to modify its behaviour:
copy /a alpha.txt + beta.txt gamma.txt
Text mode - which will copy the text content of the file, stopping when it reaches the EOF character.
copy /b alpha.mpg + beta.mpg gamma.mpg
Binary mode - which will concatenate files in their entirety, ignoring EOF characters.