# File copying

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

Act of creating a new computer file with content matching an exiting file

This article needs more citations. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "File copying" – news · newspapers · books · scholar · JSTOR (December 2009) (Learn how and when to remove this message)

In [computing](/source/Computing), **file copying** is the act of creating a new [file](/source/Computer_file) such that it has the same content as an existing file. The operation is sometimes called *cloning*.

Generally, an [operating system](/source/Operating_system) [command-line](/source/Command-line) [shell](/source/Shell_(computing)) provides for file copying via commands [cp](/source/Cp_(Unix)), [copy](/source/COPY_(command)) and similar variants. [mv](/source/Mv_(Unix)) also copies files but only when the source and destination are on different [file systems](/source/File_system). [Windows](/source/Windows) also provides includes the more advanced tools: [Robocopy](/source/Robocopy) and [xcopy](/source/Xcopy).

Many operating systems also provide for copying files via a [graphical user interface](/source/Graphical_user_interface), such as a [file manager](/source/File_manager). It may provide for [copy-and-paste](/source/Copy-and-paste) and [drag-and-drop](/source/Drag-and-drop) [user experience](/source/User_experience).

Notable third-party utilities:

- [FastCopy](/source/FastCopy)

- [Rclone](/source/Rclone)

- [RichCopy](/source/RichCopy)

- [rsync](/source/Rsync)

- [TeraCopy](/source/TeraCopy)

- [Ultracopier](/source/Ultracopier)

## Shadow copy

Shadowing describes the process of maintaining a copy of a set of files, a.k.a. to [mirror](/source/Disk_mirroring) files in a separate physical location. Depending on the reasons behind the shadow operation, this location may be as close as the [BIOS](/source/BIOS) chip to the [RAM](/source/RAM) modules or as far away as the other side of the [globe](/source/Earth).

## Remote copy

Some systems have specialized [system calls](/source/System_call) for copying files (like CopyFile in [Windows API](/source/Windows_API)), while others (like Unix-based and DOS) simply read the contents of the existing file into memory and write it to a new file. A specialized system call provides little advantage for files on local [storage](/source/Computer_storage), but can optimize operation when the source and target files are on a remote [file server](/source/File_server). The system call can tell the server to process the files on the server's file system, without sending file content over the network, thus greatly improving performance. Lacking such file server support, copying requires reading file content over the network, and sending it back over the network again.

Sometimes, remote file copying is performed with a specialized command, like NCOPY in DOS clients for [Novell NetWare](/source/Novell_NetWare). The [COPY](/source/COPY_(DOS_command)) command in some versions of [DR-DOS](/source/DR-DOS) since 1992,[1] has built-in support for this. An even more complicated situation arises when one needs to copy files between two remote servers. The simple way is to read data from one server, and then to write the data to the second server.

## See also

- [Computer file § Moving methods](/source/Computer_file#Moving_methods)

- [Backup software](/source/Backup_software)

- [Disk cloning](/source/Disk_cloning)

- [Disk mirroring](/source/Disk_mirroring)

- [File synchronization](/source/File_synchronization)

- [Hard copy](/source/Hard_copy)

- [ln (Unix)](/source/Ln_(Unix))

- [NTFS junction point](/source/NTFS_junction_point)

- [Optical disc authoring](/source/Optical_disc_authoring)

- [Peripheral Interchange Program](/source/Peripheral_Interchange_Program)

- [Zero copy](/source/Zero_copy)

## References

1. **[^](#cite_ref-Caldera_1997_DOSSRC_1-0)** ["Caldera OpenDOS Machine Readable Source Kit (M.R.S) 7.01"](https://archive.sundby.com/retro/DR-DOS/dossrc.zip). [Caldera, Inc.](/source/Caldera_(company)) 1997-05-01. [Archived](https://web.archive.org/web/20210807095409/https://archive.sundby.com/retro/DR-DOS/dossrc.zip) from the original on 2021-08-07. Retrieved 2022-01-02. [\[1\]](https://web.archive.org/web/20220102102656/https://archive.sundby.com/retro/OpenDOS/OPENDOS_7.01_CODE.ZIP) (NB. Actually implemented since [DR DOS "Panther"](/source/DR_DOS_%22Panther%22) on 1992-06-22, see COMCPY.C/DOSIF.ASM in the COMMAND.COM sources of [OpenDOS 7.01](/source/OpenDOS_7.01).)

## Further reading

- [N-level file shadowing and recovery in a shared file system](http://www.freepatentsonline.com/5043876.html), United States Patent 5043876

- [Method of file shadowing among peer systems](http://www.freepatentsonline.com/5276871.html), United States Patent 5276871

- [Database Shadow Files](https://web.archive.org/web/20061127130733/http://www.ibexpert.info/documentation/%20%209.%20IBExpert%20Services%20Menu/%20%202.%20Restore%20Database/%20%201.%20Database%20Shadow%20Files/15713.html)

## External links

- [Instructions on how to shadow files](https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Shadowing.html) for [Emacs](/source/Emacs)

v t e Computer files Types Binary file / text file Data file File format List of file formats List of File signatures Magic number Open file formats Proprietary file formats Metafile Sidecar file Sparse file Swap file System file Temporary file Zero-byte file Properties Filename 8.3 filename Long filename Filename mangling Filename extension List of filename extensions File attribute Extended file attributes File size Hidden file / Hidden directory Organisation Directory/folder NTFS links Temporary folder Directory structure File system Filesystem Hierarchy Standard Grid file system Semantic file system Path Operations Open Close Read Write Linking File descriptor Hard link Shortcut Alias Shadow Symbolic link Management Backup File comparison File copying Data compression File manager Comparison of file managers File system fragmentation File-system permissions File transfer File sharing File synchronization File verification

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