copy (command)

{{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 copy command

| developer = DEC, Intel, MetaComCo, Heath Company, Zilog, Microware, HP, Microsoft, IBM, DR, TSL, Datalight, Novell, Toshiba

| released =

| latest release version =

| latest release date =

| operating system = RT-11, OS/8, RSX-11, ISIS-II, iRMX 86, TOPS-10, TOPS-20, OpenVMS, TRIPOS, HDOS, DOS, MSX-DOS, FlexOS, 4680 OS, 4690 OS, PC-MOS, Z80-RIO, OS-9, MPE/iX, OS/2, Windows, ReactOS, SymbOS, DexOS

| genre = Command

| license = HDOS: PD
MS-DOS: MIT
PC-MOS: GPL v3
ReactOS: GPL v2

| website =

}}

copy is a shell command for copying files.{{Cite web|url=https://technet.microsoft.com/en-us/library/bb490886.aspx|title=Microsoft TechNet Copy article|date=11 September 2009 }}{{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}}

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 (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, copy path con outputs the file at path to the console, and copy con path copies text typed at the console to a file at path

Implementations

The command is available in RT-11,{{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}} OS/8,"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}} RSX-11,{{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}} ISIS-II,[http://bitsavers.org/pdf/intel/ISIS_II/9800306-06_ISIS-II_Users_Guide_May81.pdf ISIS II Users Guide] iRMX 86,{{Cite web|url=https://archive.org/details/bitsavers_inteliRMX1_19819263|title=intel :: iRMX :: 146194-001 irmxR6Intro|via=Internet Archive}} TOPS-10,{{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 }} TOPS-20,{{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

}} OpenVMS,{{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 }} MetaComCo TRIPOS,{{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}} HDOS,{{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 }} Z80-RIO,[https://www.z80cpu.eu/mirrors/oldcomputers.dyndns.org/public/pub/rechner/zilog/zds/z80-rio_os_userman.pdf Z80-RIO OPERATING SYSTEM USER'S MANUAL] OS-9,{{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}} DOS, FlexOS,{{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 }} 4690 OS,[https://archive.org/details/4690OSV6r2UsersGuide/page/n169]{{dead link|date=September 2020}} PC-MOS,{{Cite web|url=https://github.com/roelandjansen/pcmos386v501|title=roelandjansen/pcmos386v501|website=GitHub|date=2 January 2022}} HP MPE/iX,{{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 }} OS/2,{{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 }} Windows,{{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 }} ROM-DOS,{{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}} ReactOS,{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub|date=3 January 2022}} SymbOS, DexOS, and 86-DOS.{{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. |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)

Under IBM PC DOS/MS-DOS the command is available since version 1.{{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|isbn=0-7356-1812-7}}

Some shells provide a copy command with a different name. In Unix-based systems, the copy command is cp. In CP/M, the command is PIP. in OpenVOS, the command is copy_file.{{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}}.

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 on lpt1.

copy letter.txt lpt1

The following outputs to stdout, like the type command.

copy letter.txt con

The following concatenates the page# files into book.txt {{endash}} like cat.

copy page1.txt+page2.txt book.txt

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; 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|isbn=978-1556152894}}
  • {{Cite book|author1=Kathy Ivens|author2=Brian Proffit|year=1993|title=OS/2 Inside & Out|publisher=Osborne McGraw-Hill|isbn=978-0078818714}}
  • {{Cite book|first=Æleen|last=Frisch|year=2001|title=Windows 2000 Commands Pocket Reference|publisher=O'Reilly|isbn=978-0-596-00148-3}}