copy (command)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

copy
Developer(s)DEC, Intel, MetaComCo, Microware, HP, Microsoft, IBM, Digital Research, Novell, ReactOS Contributors
Operating systemRT-11, RSX-11, OS/8, ISIS-II, iRMX 86, TOPS-10, TOPS-20, OpenVMS, TRIPOS, DOS, OS-9, FlexOS, 4690 OS, MPE/iX, OS/2, Windows, ReactOS, SymbOS, DexOS
TypeCommand
LicenseMS-DOS: MIT
ReactOS: GPL

In computing, copy is a command in various operating systems. The command copies computer files from one directory to another.[1][2]

Overview[edit]

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.

Implementations[edit]

The command is available in DEC RT-11,[3] RSX-11, OS/8,[4] Intel ISIS-II,[5] iRMX 86,[6] DEC TOPS-10,[7] TOPS-20,[8] OpenVMS, MetaComCo TRIPOS,[9] Microware OS-9,[10] DOS, DR FlexOS,[11] IBM/Toshiba 4690 OS,[12] HP MPE/iX,[13] IBM OS/2,[14] Microsoft Windows, ReactOS,[15] SymbOS and DexOS.

On MS-DOS it is available in versions 1 and later[16] and also available in the open-source MS-DOS emulator DOSBox. DR DOS 6.0 also includes an implementation of the COPY command.[17]

The equivalent Unix command is cp, the CP/M command is PIP. A more advanced copy command is called xcopy. The command is analogous to the Stratus OpenVOS copy_file command.[18]

Example for DOS[edit]

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

See also[edit]

References[edit]

  1. ^ Microsoft TechNet Copy article
  2. ^ https://archive.org/details/1988-rugheimer-spanik-amigados-quick-reference
  3. ^ http://paleoferrosaurus.com/beta/documents/rt11help.html#COPY
  4. ^ "Concise Command Language" (CCL)."OS/8 Handbook" (PDF). April 1974. Retrieved 28 November 2017.
  5. ^ ISIS II Users Guide
  6. ^ iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6
  7. ^ TOPS-10 Operating System Commands Manual (pdf). Digital Equipment Corporation. August 1980. Retrieved 17 February 2019.
  8. ^ "TOPS-20 Command manual" (PDF).
  9. ^ https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf
  10. ^ Paul S. Dayan (1992). The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. ISBN 0-9519228-0-7.
  11. ^ http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf
  12. ^ https://archive.org/details/4690OSV6r2UsersGuide/page/n169
  13. ^ MPE/iX Command Reference Manual
  14. ^ http://www.jatomes.com/Help/Os2Cmd.php#COPY
  15. ^ https://github.com/reactos/reactos/blob/master/base/shell/cmd/copy.c
  16. ^ Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
  17. ^ DR DOS 6.0 User Guide Optimisation and Configuration Tips
  18. ^ http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf

Further reading[edit]

External links[edit]