To copy computer documents, pictures, or other files from one place to another, follow these instructions.

Select your operating system in the list below to view the instructions that apply to you.

When copying files, you are going to get more than one copy of the file on your computer. If you want only one copy of the files, move them instead. For help with moving, see: How to move files and folders on the computer.

A file name must be unique. If it’s not, a number is appended to the end of a file name. It may also have “- Copy” appended to the end of the file name, instead of a number. Appending a number to the end of the copied file’s name assures the copied file is unique. For example, if the original file name is abc123.pdf and a copy is created in the same directory or folder, the copied file name could be abc123(1).pdf or abc123 - Copy.pdf.

How to copy a file in Microsoft Windows

Below are the steps on how to copy a file or multiple files in Microsoft Windows from one location to another.

  • Microsoft Windows

  • MS-DOS and Windows command line

  • Batch file

  • Linux and Unix

  • Apple macOS

  • Go to the files or folders you want to copy. If you need help locating the files, use the Windows find feature.

  • Highlight the file or files you want to copy by clicking them once with the mouse. If you need to highlight more than one file, hold down the Ctrl or Shift keys on your keyboard, or drag a box around the files you want to copy.

  • Once highlighted, right-click one of the highlighted files and select Copy. Users may also press the Ctrl+C shortcut key, or in Windows Explorer, click Edit at the top of the window and select Copy.

  • Open the destination folder, right-click an empty space in the folder, and select Paste. Or, in the menu bar at the top, click File, choose Edit, then select Paste.

  • How to select or highlight multiple files and folders.

How to copy a file in MS-DOS and the Windows command line

Below are steps on how to copy a single file from one directory to another directory in MS-DOS or the Windows command line.

If you want to copy only a certain type of file, click the Type column in Windows Explorer. This action sorts files by type, rather than by name. Once grouped by type, you can select only the files with the type you want to copy, and then copy those files.

You can also use the Windows command line to copy files. In some situations, such as copying multiple files of a certain extension or with a certain name, it can be easier.

Copying a single file

  • Using the cd command, move to the directory containing the file you want to copy.
  • Type a command similar to the following.

copy myfile.txt c:\my\location

In the example above, substitute “myfile.txt” with the name of the file you want to copy, and “c:\my\location” with the destination directory. To see files available in the current directory, use the dir command.

Copying multiple files to another location

Below are the steps on how to copy multiple files from one directory to another directory.

  • Using the cd command, move to the directory containing the files you want to copy.
  • Once in the directory containing the files you want to copy, type a command similar to one of the following commands.

copy . c:\mydir

In the example above, the command would copy every file in the current directory to the “mydir” directory.

copy *.txt c:\mydir

In the example above, the command would copy every txt, or text file, in the current directory to the “mydir” directory.

xcopy hope example /e

If you need to copy files, directories, and subdirectories, use the xcopy command. In the example above, the xcopy command copies all directories (even empty directories) and files from the “hope” directory to the example directory.

For additional examples of wildcard characters, see our wildcard definition.

Copying long file name files or files with spaces

Often, you can encounter a file with spaces in the file name. To copy these files, surround the full file name and file extension in quotes.

copy “computer hope.txt” “there is hope.txt”

In the example above, the “computer hope.txt” file is surrounded in quotes to let the command line know the complete file name, thus eliminating the spaces.

How to copy files to another drive

You can also copy files from the current location to any other drive. For example, if you have a USB flash drive that is drive letter F:, you can use the following command to copy all JPEG image files to the flash drive.

copy *.jpg f:

  • How to change drives in MS-DOS and Windows command line.

How to make a copy of a file into the same directory

copy example.txt backup.txt

In the example above, the file “example.txt” is copied to the same directory as “backup.txt,” effectively making a backup copy of the file.

  • See the cd command, dir command, copy command, and xcopy command pages for further information about each MS-DOS command.
  • How to use the Windows command line (DOS).

Batch file

To perform any copy command in a batch file, include any of the Windows command line copy commands above in a batch file.

  • How to make a batch file.

How to copy files in Linux and Unix

Below are steps on how to copy a single file from one directory to another directory in Linux and Unix.

Copying a single file from one location to another

cp myfile.txt /usr/bin

In the example above, substitute “myfile.txt” with the name of the file you want to copy, and “/usr/bin” with the destination directory. To see files available in the current directory, use the ls command.

Below are the steps on how to copy multiple files from one directory to another directory.

cp . /usr/bin

In the example above, the command would copy every file in the current directory to the “/usr/bin” directory.

cp *.txt /usr/bin

In the example above, the command would copy every txt, or text file, in the current directory to the “/usr/bin” directory.

Copying files with spaces in the file names

cp “computer hope.txt” “there is hope.txt”

In the example above, the “computer hope.txt” file is surrounded in quotes to let the command line know the complete file name. In our example, the destination file name contains whitespace (spaces), so the name is enclosed in quotes.

cp example.txt backup.txt

  • See the cd command, cp command, and ls command pages for additional information about these commands.
  • For general help using the Linux command line, see our Linux and Unix shell tutorial.

How to copy files in Apple macOS

Drag-and-drop

Highlight the files you want to copy. Then, click the highlighted files with the left mouse button and, while continuing to hold down the mouse button, drag-and-drop the files to where you want to copy them. When you release the mouse button, the files are copied.

Keyboard shortcut

You can also copy files using keyboard shortcuts by following these steps.

  • Highlight the files you want to copy.
  • Press the keyboard shortcut Command+C.
  • Move to the location you want to move the files and press Command+V to copy the files.

Terminal

To copy files in a Terminal session, use the cp command.

  • How to select or highlight multiple files and folders.
  • How to copy information from one computer to another.
  • How to copy information to and from a floppy diskette or CD.
  • How to move files and folders on the computer.
  • See the copy definition for further information and related links.
  • Computer file help and support.