# Copy (command)

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Copy_(command)
> Markdown URL: https://mediated.wiki/source/Copy_(command).md
> Source: https://en.wikipedia.org/wiki/Copy_(command)
> Source revision: 1328451495
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Shell command for copying files}}
{{For | the command for copying with the clipboard | Cut, copy, and paste}}
{{lowercase}}
{{Use dmy dates|date=February 2019|cs1-dates=y}}
{{Infobox software
| name                   = copy
| logo                   =
| screenshot             = ReactOS-0.4.13 copy command 667x434.png
| screenshot size        =
| caption                = The [ReactOS](/source/ReactOS) <code>copy</code> command
| developer              = [DEC](/source/Digital_Equipment_Corporation), [Intel](/source/Intel), [MetaComCo](/source/MetaComCo), [Heath Company](/source/Heath_Company), [Zilog](/source/Zilog), [Microware](/source/Microware), [HP](/source/Hewlett-Packard), [Microsoft](/source/Microsoft), [IBM](/source/IBM), [DR](/source/Digital_Research), [TSL](/source/The_Software_Link), [Datalight](/source/Datalight), [Novell](/source/Novell), [Toshiba](/source/Toshiba)
| released               =
| latest release version =
| latest release date    =
| operating system       = [RT-11](/source/RT-11), [OS/8](/source/OS%2F8), [RSX-11](/source/RSX-11), [ISIS-II](/source/ISIS_(operating_system)), [iRMX 86](/source/RMX_(operating_system)), [TOPS-10](/source/TOPS-10), [TOPS-20](/source/TOPS-20), [OpenVMS](/source/OpenVMS), [TRIPOS](/source/TRIPOS), [HDOS](/source/HDOS), [DOS](/source/DOS), [MSX-DOS](/source/MSX-DOS), [FlexOS](/source/FlexOS), [4680 OS](/source/4680_OS), [4690 OS](/source/4690_OS), [PC-MOS](/source/PC-MOS), [Z80-RIO](/source/Z80-RIO), [OS-9](/source/OS-9), [MPE/iX](/source/HP_Multi-Programming_Executive), [OS/2](/source/OS%2F2), [Windows](/source/Microsoft_Windows), [ReactOS](/source/ReactOS), [SymbOS](/source/SymbOS), DexOS
| genre                  = [Command](/source/Command_(computing))
| license                = HDOS: [PD](/source/Public_domain)<br />MS-DOS: [MIT](/source/MIT_License)<br />PC-MOS: [GPL v3](/source/GPL_v3)<br />ReactOS: [GPL v2](/source/GPL_v2)
| website                =
}}
'''<code>copy</code>''' is a [shell](/source/shell_(computing)) [command](/source/command_(computing)) for [copying](/source/File_copying) [files](/source/computer_file).<ref>{{Cite web|url=https://technet.microsoft.com/en-us/library/bb490886.aspx|title=Microsoft TechNet Copy article|date=11 September 2009 }}</ref><ref>{{Cite book|url=https://archive.org/details/1988-rugheimer-spanik-amigados-quick-reference|title=AmigaDOS quick reference|first1=Hannes|last1=Rügheimer|first2=Christian|last2=Spanik|date=14 September 1988|publisher=Grand Rapids, Mi : Abacus|isbn=9781557550491|via=Internet Archive}}</ref>

Different implementations provide various capabilities, such as:
* Combining (concatenating) multiple files into a single file
* If multiple source files are specified before the path to an existing directory, then files are copied to the directory
* Support for text vs. binary data; for text, the command stops when it reaches an [end-of-file](/source/end-of-file) (EOF) character; for binary, files are copied in their entirety, ignoring EOF
* In DOS, a file can be copied to or from a device. For example, <code>copy ''path'' con</code> outputs the file at ''path'' to the console, and <code>copy con ''path''</code> copies text typed at the console to a file at ''path''

==Implementations==
The command is available in [RT-11](/source/RT-11),<ref>{{Cite web|url=http://paleoferrosaurus.com/beta/documents/rt11help.html#COPY|title=RT-11 HELP FILE|website=paleoferrosaurus.com|access-date=2019-07-06 |archive-date=2018-07-17 |archive-url=https://web.archive.org/web/20180717041552/http://paleoferrosaurus.com/beta/documents/rt11help.html#COPY|url-status=dead}}</ref> [OS/8](/source/OS%2F8),<ref name="OS8.HandB">"Concise Command Language" (CCL).{{cite web|url=http://bitsavers.trailing-edge.com/pdf/dec/pdp8/os8/OS8_Handbook_Apr1974.pdf
|title=OS/8 Handbook |date=April 1974 |access-date=28 November 2017}}</ref> [RSX-11](/source/RSX-11),<ref>{{Cite book |title=RSX A Guide for Users |date=1987 |author=John F. Pieper |publisher=Digital Equipment Corporation |url=http://www.rsx11m.com/rsxguide.pdf |isbn=0-932376-90-8 |access-date=2020-09-19}}</ref> [ISIS-II](/source/ISIS_(operating_system)),<ref>[http://bitsavers.org/pdf/intel/ISIS_II/9800306-06_ISIS-II_Users_Guide_May81.pdf ISIS II Users Guide]</ref> [iRMX 86](/source/RMX_(operating_system)),<ref>{{Cite web|url=https://archive.org/details/bitsavers_inteliRMX1_19819263|title=intel :: iRMX :: 146194-001 irmxR6Intro|via=Internet Archive}}</ref> [TOPS-10](/source/TOPS-10),<ref>{{Cite book |title=TOPS-10 Operating System Commands Manual |date=August 1980 |publisher=Digital Equipment Corporation |url=http://scandocs.trailing-edge.com/tops10-aa-0916d-tb.pdf |access-date=2019-02-17 |archive-date=2020-08-09  |archive-url=https://web.archive.org/web/20200809145058/http://scandocs.trailing-edge.com/tops10-aa-0916d-tb.pdf |url-status=dead }}</ref> [TOPS-20](/source/TOPS-20),<ref name=CMDref>{{cite web
|url=http://www.textfiles.com/bitsavers/pdf/dec/pdp10/TOPS20/V6.1/AA-FP65A-TM_tops20CmdsRef.pdf
|title=TOPS-20 Command manual
|access-date=2018-07-18 
|archive-date=2020-08-09 
|archive-url=https://web.archive.org/web/20200809103116/http://www.textfiles.com/bitsavers/pdf/dec/pdp10/TOPS20/V6.1/AA-FP65A-TM_tops20CmdsRef.pdf
|url-status=dead
}}</ref> [OpenVMS](/source/OpenVMS),<ref>{{Cite web|url=https://www.itec.suny.edu/scsys/vms/OVMSDOC073/v73/6489/6489pro_005.html|title=OpenVMS User's Manual|website=www.itec.suny.edu}}{{Dead link|date=December 2023 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> [MetaComCo](/source/MetaComCo) [TRIPOS](/source/TRIPOS),<ref>{{cite web |url=https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf |title= Operating manual |website=www.pagetable.com |access-date=2020-09-14}}</ref> [HDOS](/source/HDOS),<ref>{{cite web |title=Software Reference Manual HDOS SYSTEM Chapter 2 General Operations |language=en |author=Heath Company |author-link=Heath Company |url=http://sebhc.lesbird.com/documentation/software/HDOS-2/HDOS_Reference_Chapter2.pdf |access-date=2020-02-08 |archive-date=2017-08-07  |archive-url=https://web.archive.org/web/20170807205702/http://sebhc.lesbird.com/documentation/software/HDOS-2/HDOS_Reference_Chapter2.pdf |url-status=dead }}</ref> [Z80-RIO](/source/Z80-RIO),<ref>{{Cite web |url=https://www.z80cpu.eu/mirrors/oldcomputers.dyndns.org/public/pub/rechner/zilog/zds/z80-rio_os_userman.pdf |title=Z80-RIO OPERATING SYSTEM USER'S MANUAL |access-date=2020-02-14  |archive-date=2022-01-28  |archive-url=https://web.archive.org/web/20220128041146/https://www.z80cpu.eu/mirrors/oldcomputers.dyndns.org/public/pub/rechner/zilog/zds/z80-rio_os_userman.pdf |url-status=dead }}</ref> [OS-9](/source/OS-9),<ref>{{cite book|author=Paul S. Dayan|year=1992|title=The OS-9 Guru - 1 : The Facts|publisher=Galactic Industrial Limited|isbn=0-9519228-0-7}}</ref> [DOS](/source/DOS), [FlexOS](/source/FlexOS),<ref>{{cite web |url=http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |title=FlexOS User's Guide |date=1986 |website=www.bitsavers.org |access-date=2020-09-14 |archive-date=2010-08-08  |archive-url=https://web.archive.org/web/20100808010315/http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |url-status=dead }}</ref> [4690 OS](/source/4690_Operating_System),<ref>[https://archive.org/details/4690OSV6r2UsersGuide/page/n169]{{dead link|date=September 2020}}</ref> [PC-MOS](/source/PC-MOS),<ref>{{Cite web|url=https://github.com/roelandjansen/pcmos386v501|title=roelandjansen/pcmos386v501|website=GitHub|date=2 January 2022}}</ref> [HP](/source/Hewlett-Packard) [MPE/iX](/source/HP_Multi-Programming_Executive),<ref>{{Cite web |url=http://www.teamnaconsulting.com/compresources/pdfs/c01687363.pdf |title=MPE/iX Command Reference Manual |access-date=2018-10-21  |archive-date=2018-10-21  |archive-url=https://web.archive.org/web/20181021232213/http://www.teamnaconsulting.com/compresources/pdfs/c01687363.pdf |url-status=dead }}</ref> [OS/2](/source/OS%2F2),<ref>{{Cite web |url=http://www.jatomes.com/Help/Os2Cmd.php#COPY |title=OS/2 Commands: Copy |access-date=20 July 2019 |archive-url=https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#COPY |archive-date=14 April 2019 |url-status=dead }}</ref> [Windows](/source/Windows),<ref>{{Cite web|url=https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/copy|title=copy|website=docs.microsoft.com|date=3 February 2023 }}</ref> [ROM-DOS](/source/ROM-DOS),<ref>{{Cite web|url=https://www.datalight.com/assets/files/ROM-DOS_Users_Guide.pdf|title=Datalight ROM-DOS User's Guide|website=www.datalight.com}}</ref> [ReactOS](/source/ReactOS),<ref>{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub|date=3 January 2022}}</ref> [SymbOS](/source/SymbOS), DexOS, and [86-DOS](/source/86-DOS).<ref>{{cite book |title=86-DOS - Disk Operating System for the 8086 - User's Manual |edition=Preliminary |version=Version 0.3 |date=1980 |publisher=[Seattle Computer Products, Inc.](/source/Seattle_Computer_Products%2C_Inc.) |location=Seattle, Washington, USA |url=http://www.patersontech.com/Dos/docs/86_Dos_usr_03.pdf |access-date=2019-07-14 |url-status=dead |archive-url=https://web.archive.org/web/20190714004434/http://www.patersontech.com/dos/docs/86_Dos_usr_03.pdf |archive-date=2019-07-14}} (59 pages)</ref> 

Under [IBM PC DOS](/source/IBM_PC_DOS)/[MS-DOS](/source/MS-DOS) the command is available since version 1.<ref name="RUNNINGMSDOS">{{Cite book|author-last=Wolverton|author-first=Van|title=Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition|date=2003|publisher=[Microsoft Press](/source/Microsoft_Press)|isbn=0-7356-1812-7}}</ref> 

Some shells provide a copy command with a different name. In [Unix](/source/Unix)-based systems, the copy command is <code>[cp](/source/cp_(Unix))</code>. In [CP/M](/source/CP%2FM), the command is <code>[PIP](/source/Peripheral_Interchange_Program)</code>. in [OpenVOS](/source/OpenVOS), the command is <code>copy_file</code>.<ref>{{cite web |url=http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf |title= OpenVOS Commands Reference Manual |website= stratadoc.stratus.com|access-date=2020-09-14}}</ref>

==DOS==
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](/source/Computer_printer) on lpt1. 

 copy letter.txt lpt1

The following outputs to [stdout](/source/stdout), like the <code>[type](/source/TYPE_(DOS_command))</code> command. 

 copy letter.txt con

The following [concatenates](/source/concatenation) the page# files into <code>book.txt</code> {{endash}} like <code>[cat](/source/cat_(Unix))</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

==See also==
* {{Annotated link|XCOPY}}

==References==
{{Reflist}}

==Further reading==
*{{Cite book|author-last=Wolverton|author-first=Van|title=MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition|date=1990|publisher=[Microsoft Press](/source/Microsoft_Press)|isbn=978-1556152894}}
*{{Cite book|author1=Kathy Ivens|author2=Brian Proffit|year=1993|title=OS/2 Inside & Out|publisher=[Osborne McGraw-Hill](/source/Osborne_McGraw-Hill)|isbn=978-0078818714}}
*{{Cite book|first=Æleen|last=Frisch|year=2001|title=Windows 2000 Commands Pocket Reference|publisher=[O'Reilly](/source/O'Reilly_Media)|isbn=978-0-596-00148-3}}

==External links==
{{Wikibooks|Guide to Windows Commands}}
* [https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/copy copy | Microsoft Docs]
* [https://github.com/microsoft/MS-DOS/blob/master/v2.0/source/COPY.ASM Open source COPY implementation that comes with MS-DOS v2.0]

{{Windows commands}}

Category:Internal DOS commands
Category:MSX-DOS commands
Category:OS/2 commands
Category:ReactOS commands
Category:Windows commands
Category:Microcomputer software
Category:Microsoft free software
Category:Windows administration
Category:File copy utilities

---
Adapted from the Wikipedia article [Copy (command)](https://en.wikipedia.org/wiki/Copy_(command)) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Copy_(command)?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
