âšī¸ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.3 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://www.computerhope.com/issues/ch000766.htm |
| Last Crawled | 2026-03-28 10:41:38 (9 days ago) |
| First Indexed | 2016-12-23 21:51:01 (9 years ago) |
| HTTP Status Code | 200 |
| Meta Title | How to Copy Files |
| Meta Description | Learn how to copy files across different operating systems, including Windows, macOS, and Linux, using methods like drag-and-drop, command-line, or batch files. |
| Meta Canonical | null |
| Boilerpipe Text | Updated:
06/01/2025
by
To copy computer documents, pictures, or other files from one place to another, follow these instructions.
Note
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.
Select your operating system in the list below to view the instructions that apply to you.
How to copy a file in Microsoft Windows
Below are the steps to copy a file or multiple files in
Microsoft
Windows from one location to another.
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
keyboard shortcut
, 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.
Tip
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.
Tip
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.
How to copy a file in MS-DOS and the Windows command line
Below are steps to copy a single file from one directory to another directory in MS-DOS or the Windows command line.
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 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.
Tip
For additional examples of wildcard characters, see our
wildcard
definition.
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.
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
(Universal Serial Bus)
flash drive
that is
drive letter
F:, you can use the following command to copy all
JPEG
(Joint Photographic Experts Group) 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.
Related pages and help
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 to copy a single file from one directory to another directory in Linux and Unix.
Copying a single file from one location to another
Using the
cd command
, move to the directory containing the file you want to copy.
Type a command similar to the following.
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
.
Copying multiple files to another location
Below are the steps 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.
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.
For additional examples of wildcard characters, see our
wildcard
definition.
Copying files with spaces in the file names
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
.
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.
How to make a copy of a file into the same directory
cp 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.
Related pages and help
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
.
Navigate to the location where you want to move the files.
Press
Command
+
V
to
paste
the copied files.
Terminal
To copy files in a
Terminal
session, use the
cp command
. |
| Markdown | [Skip to Main Content](https://www.computerhope.com/issues/ch000766.htm#main-content)
[](https://www.computerhope.com/)
- [Help](https://www.computerhope.com/oh.htm "Questions and answers, troubleshooting, and help")
- [Tips](https://www.computerhope.com/tips/ "Computer tips and tricks")
- [Dictionary](https://www.computerhope.com/jargon.htm "Computer terms, jargon, and glossary")
- [History](https://www.computerhope.com/history/ "Computer timeline, events, and biographies")
- [Forums](https://www.computerhope.com/forum/ "Computer Hope forums and community")
- [Contact](https://www.computerhope.com/contact/ "Contact Computer Hope or other computer companies")
1. [Home](https://www.computerhope.com/)
2. [Help](https://www.computerhope.com/oh.htm)
3. [Software Help](https://www.computerhope.com/sofqa.htm)
4. [File Help](https://www.computerhope.com/software/file.htm)
# How to copy files
Updated: 06/01/2025 by [Computer Hope](https://www.computerhope.com/more.htm)

To copy computer documents, pictures, or other files from one place to another, follow these instructions.
Note
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.](https://www.computerhope.com/issues/ch001476.htm)
Note
A file name must be unique. If it's not, a number is [appended](https://www.computerhope.com/jargon/a/append.htm) 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.
Select your operating system in the list below to view the instructions that apply to you.
- [Microsoft Windows.](https://www.computerhope.com/issues/ch000766.htm#windows)
- [MS-DOS and Windows command line.](https://www.computerhope.com/issues/ch000766.htm#command-line)
- [Batch file.](https://www.computerhope.com/issues/ch000766.htm#batch)
- [Linux and Unix.](https://www.computerhope.com/issues/ch000766.htm#linux)
- [Apple macOS.](https://www.computerhope.com/issues/ch000766.htm#mac)
- [Related information.](https://www.computerhope.com/issues/ch000766.htm#related)
## How to copy a file in Microsoft Windows

Below are the steps to copy a file or multiple files in [Microsoft](https://www.computerhope.com/comp/msoft.htm) Windows from one location to another.
1. Go to the [files](https://www.computerhope.com/jargon/f/file.htm) or [folders](https://www.computerhope.com/jargon/f/folder.htm) you want to copy. If you need help locating the files, use the [Windows find feature](https://www.computerhope.com/issues/chfind.htm).
2. [Highlight](https://www.computerhope.com/jargon/h/highligh.htm) the file or files you want to copy by clicking them once with the [mouse](https://www.computerhope.com/jargon/m/mouse.htm). If you need to highlight more than one file, hold down the [`Ctrl`](https://www.computerhope.com/jargon/c/ctrl.htm) or [`Shift`](https://www.computerhope.com/jargon/s/shiftkey.htm) keys on your [keyboard](https://www.computerhope.com/jargon/k/keyboard.htm), or drag a box around the files you want to copy.
3. Once highlighted, [right-click](https://www.computerhope.com/jargon/r/righclic.htm) one of the highlighted files and select **Copy**. Users may also press the [`Ctrl`\+`C`](https://www.computerhope.com/jargon/c/ctrlc.htm) [keyboard shortcut](https://www.computerhope.com/jargon/k/keyboard-shortcut.htm), or in [Windows Explorer](https://www.computerhope.com/jargon/e/explorer.htm), click **Edit** at the top of the window and select **Copy**.
4. Open the destination folder, right-click an empty space in the folder, and select **[Paste](https://www.computerhope.com/jargon/p/paste.htm)**. Or, in the menu bar at the top, click **File**, choose **Edit**, then select **Paste**.
- [How to select or highlight multiple files and folders.](https://www.computerhope.com/issues/ch000771.htm)
Tip
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.
Tip
You can also use the [Windows command line](https://www.computerhope.com/jargon/c/commandi.htm) to copy files. In some situations, such as copying multiple files of a certain extension or with a certain name, it can be easier.
## How to copy a file in MS-DOS and the Windows command line

Below are steps to copy a single file from one directory to another directory in MS-DOS or the Windows command line.
### Copying a single file
1. Using the [cd command](https://www.computerhope.com/cdhlp.htm), move to the directory containing the file you want to copy.
2. 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](https://www.computerhope.com/jargon/d/director.htm). To see files available in the [current directory](https://www.computerhope.com/jargon/c/currentd.htm), use the [dir command](https://www.computerhope.com/dirhlp.htm).
### Copying multiple files to another location
Below are the steps to copy multiple files from one directory to another directory.
1. Using the [cd command](https://www.computerhope.com/cdhlp.htm), move to the directory containing the files you want to copy.
2. 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.
Tip
For additional examples of wildcard characters, see our [wildcard](https://www.computerhope.com/jargon/w/wildcard.htm) definition.
```
xcopy hope example /e
```
If you need to copy files, directories, and subdirectories, use the [xcopy command](https://www.computerhope.com/xcopyhlp.htm). In the example above, the xcopy command copies all directories (even empty directories) and files from the "hope" directory to the example directory.
### 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](https://www.computerhope.com/jargon/f/fileext.htm) in [quotes](https://www.computerhope.com/jargon/q/quote.htm).
```
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](https://www.computerhope.com/jargon/u/usb.htm) (Universal Serial Bus) [flash drive](https://www.computerhope.com/jargon/j/jumpdriv.htm) that is [drive letter](https://www.computerhope.com/jargon/d/drivelet.htm) F:, you can use the following command to copy all [JPEG](https://www.computerhope.com/jargon/j/jpeg.htm) (Joint Photographic Experts Group) image files to the flash drive.
```
copy *.jpg f:
```
- [How to change drives in MS-DOS and Windows command line.](https://www.computerhope.com/issues/ch000515.htm)
### 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](https://www.computerhope.com/jargon/b/backup.htm) copy of the file.
### Related pages and help
- See the [cd command](https://www.computerhope.com/cdhlp.htm), [dir command](https://www.computerhope.com/dirhlp.htm), [copy command](https://www.computerhope.com/copyhlp.htm), and [xcopy command](https://www.computerhope.com/xcopyhlp.htm) pages for further information about each MS-DOS command.
- [How to use the Windows command line (DOS).](https://www.computerhope.com/issues/chusedos.htm)
## Batch file
To perform any copy command in a batch file, include any of the [Windows command line copy commands](https://www.computerhope.com/issues/ch000766.htm#command-line) above in a batch file.
- [How to make a batch file.](https://www.computerhope.com/issues/ch001666.htm)
## How to copy files in Linux and Unix

Below are steps to copy a single file from one directory to another directory in Linux and Unix.
### Copying a single file from one location to another
1. Using the [cd command](https://www.computerhope.com/unix/ucd.htm), move to the directory containing the file you want to copy.
2. Type a command similar to the following.
```
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](https://www.computerhope.com/jargon/d/director.htm). To see files available in the [current directory](https://www.computerhope.com/jargon/c/currentd.htm), use the [ls command](https://www.computerhope.com/unix/uls.htm).
### Copying multiple files to another location
Below are the steps to copy multiple files from one directory to another directory.
1. Using the [cd command](https://www.computerhope.com/unix/ucd.htm), move to the directory containing the files you want to copy.
2. Once in the directory containing the files you want to copy, type a command similar to one of the following commands.
```
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.
For additional examples of wildcard characters, see our [wildcard](https://www.computerhope.com/jargon/w/wildcard.htm) definition.
### Copying files with spaces in the file names
Often, you can encounter a file with spaces in the file name. To copy these files, surround the full file name and [file extension](https://www.computerhope.com/jargon/f/fileext.htm) in [quotes](https://www.computerhope.com/jargon/q/quote.htm).
```
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](https://www.computerhope.com/jargon/w/whitspac.htm) (spaces), so the name is enclosed in quotes.
### How to make a copy of a file into the same directory
```
cp 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](https://www.computerhope.com/jargon/b/backup.htm) copy of the file.
### Related pages and help
- See the [cd command](https://www.computerhope.com/unix/ucd.htm), [cp command](https://www.computerhope.com/unix/ucp.htm), and [ls command](https://www.computerhope.com/unix/uls.htm) pages for additional information about these commands.
- For general help using the Linux command line, see our [Linux and Unix shell tutorial.](https://www.computerhope.com/issues/chshell.htm)
## How to copy files in Apple macOS
### Drag-and-drop
[Highlight](https://www.computerhope.com/jargon/h/highligh.htm) 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](https://www.computerhope.com/jargon/d/dragdrop.htm) 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.
1. Highlight the files you want to copy.
2. Press the keyboard shortcut [`Command`\+`C`](https://www.computerhope.com/jargon/c/cmd-c.htm).
3. Navigate to the location where you want to move the files.
4. Press [`Command`\+`V`](https://www.computerhope.com/jargon/c/cmd-v.htm) to [paste](https://www.computerhope.com/jargon/p/paste.htm) the copied files.
### Terminal
To copy files in a [Terminal](https://www.computerhope.com/jargon/t/terminal.htm) session, use the [cp command](https://www.computerhope.com/unix/ucp.htm).
## Related information
- [How to select or highlight multiple files and folders.](https://www.computerhope.com/issues/ch000771.htm)
- [How to copy information from one computer to another.](https://www.computerhope.com/issues/ch000600.htm)
- [How to copy information to and from a floppy diskette or CD.](https://www.computerhope.com/issues/ch000823.htm)
- [How to move files and folders on the computer.](https://www.computerhope.com/issues/ch001476.htm)
- See the [copy](https://www.computerhope.com/jargon/c/copy.htm) definition for further information.
- [Computer file help.](https://www.computerhope.com/software/file.htm)
- Was this page useful?[Yes](https://www.computerhope.com/cgi-bin/feedback.cgi?yes)[No](https://www.computerhope.com/cgi-bin/feedback.cgi?no)
- - [Feedback](https://www.computerhope.com/feedback/ "Give us your feedback about this page")
- [E-mail](https://www.computerhope.com/contact/ "E-mail Computer Hope")
- [Share](https://www.computerhope.com/share/ "Share this page with friends and social networks")
- [Print](https://www.computerhope.com/issues/ch000766.htm "Print a copy of this page")
- 1. Recently added pages
2. [What to do when Microsoft ends support for Windows?](https://www.computerhope.com/issues/ch001542.htm)
3. [What is Drag Click?](https://www.computerhope.com/jargon/d/drag-click.htm)
4. [What Is TPM (Trusted Platform Module)?](https://www.computerhope.com/jargon/t/tpm.htm)
5. [What is Xbox Game Pass?](https://www.computerhope.com/jargon/x/xbox-game-pass.htm)
6. [How to Use AI to Create Images.](https://www.computerhope.com/issues/ch002394.htm)
7. [View all recent updates](https://www.computerhope.com/whatnew.htm)
- 1. Useful links
2. [About Computer Hope](https://www.computerhope.com/more.htm)
3. [Cookie Preferences](https://www.computerhope.com/issues/ch000766.htm)
4. [Site Map](https://www.computerhope.com/sindex.htm)
5. [Forum](https://www.computerhope.com/forum/)
6. [Contact Us](https://www.computerhope.com/contact/)
7. [How to Help](https://www.computerhope.com/issues/ch000586.htm)
8. [Top 10 pages](https://www.computerhope.com/chtop10.htm)
- 1. Follow us
2. [Facebook](https://www.facebook.com/computerhope/)
3. [YouTube](https://www.youtube.com/computerhope?sub_confirmation=1)
4. [RSS](https://www.computerhope.com/rss.htm)
[Computer Hope home page](https://www.computerhope.com/)Š 2026 Computer Hope
[Legal Disclaimer - Privacy Statement](https://www.computerhope.com/legal.htm)
[Back to Top](https://www.computerhope.com/issues/ch000766.htm) |
| Readable Markdown | Updated: 06/01/2025 by

To copy computer documents, pictures, or other files from one place to another, follow these instructions.
Note
A file name must be unique. If it's not, a number is [appended](https://www.computerhope.com/jargon/a/append.htm) 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.
Select your operating system in the list below to view the instructions that apply to you.
## How to copy a file in Microsoft Windows

Below are the steps to copy a file or multiple files in [Microsoft](https://www.computerhope.com/comp/msoft.htm) Windows from one location to another.
1. Go to the [files](https://www.computerhope.com/jargon/f/file.htm) or [folders](https://www.computerhope.com/jargon/f/folder.htm) you want to copy. If you need help locating the files, use the [Windows find feature](https://www.computerhope.com/issues/chfind.htm).
2. [Highlight](https://www.computerhope.com/jargon/h/highligh.htm) the file or files you want to copy by clicking them once with the [mouse](https://www.computerhope.com/jargon/m/mouse.htm). If you need to highlight more than one file, hold down the [`Ctrl`](https://www.computerhope.com/jargon/c/ctrl.htm) or [`Shift`](https://www.computerhope.com/jargon/s/shiftkey.htm) keys on your [keyboard](https://www.computerhope.com/jargon/k/keyboard.htm), or drag a box around the files you want to copy.
3. Once highlighted, [right-click](https://www.computerhope.com/jargon/r/righclic.htm) one of the highlighted files and select **Copy**. Users may also press the [`Ctrl`\+`C`](https://www.computerhope.com/jargon/c/ctrlc.htm) [keyboard shortcut](https://www.computerhope.com/jargon/k/keyboard-shortcut.htm), or in [Windows Explorer](https://www.computerhope.com/jargon/e/explorer.htm), click **Edit** at the top of the window and select **Copy**.
4. Open the destination folder, right-click an empty space in the folder, and select **[Paste](https://www.computerhope.com/jargon/p/paste.htm)**. Or, in the menu bar at the top, click **File**, choose **Edit**, then select **Paste**.
- [How to select or highlight multiple files and folders.](https://www.computerhope.com/issues/ch000771.htm)
Tip
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.
Tip
You can also use the [Windows command line](https://www.computerhope.com/jargon/c/commandi.htm) to copy files. In some situations, such as copying multiple files of a certain extension or with a certain name, it can be easier.
## How to copy a file in MS-DOS and the Windows command line

Below are steps to copy a single file from one directory to another directory in MS-DOS or the Windows command line.
### Copying a single file
1. Using the [cd command](https://www.computerhope.com/cdhlp.htm), move to the directory containing the file you want to copy.
2. 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](https://www.computerhope.com/jargon/d/director.htm). To see files available in the [current directory](https://www.computerhope.com/jargon/c/currentd.htm), use the [dir command](https://www.computerhope.com/dirhlp.htm).
### Copying multiple files to another location
Below are the steps to copy multiple files from one directory to another directory.
1. Using the [cd command](https://www.computerhope.com/cdhlp.htm), move to the directory containing the files you want to copy.
2. 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.
Tip
For additional examples of wildcard characters, see our [wildcard](https://www.computerhope.com/jargon/w/wildcard.htm) definition.
```
xcopy hope example /e
```
If you need to copy files, directories, and subdirectories, use the [xcopy command](https://www.computerhope.com/xcopyhlp.htm). In the example above, the xcopy command copies all directories (even empty directories) and files from the "hope" directory to the example directory.
### 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](https://www.computerhope.com/jargon/f/fileext.htm) in [quotes](https://www.computerhope.com/jargon/q/quote.htm).
```
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](https://www.computerhope.com/jargon/u/usb.htm) (Universal Serial Bus) [flash drive](https://www.computerhope.com/jargon/j/jumpdriv.htm) that is [drive letter](https://www.computerhope.com/jargon/d/drivelet.htm) F:, you can use the following command to copy all [JPEG](https://www.computerhope.com/jargon/j/jpeg.htm) (Joint Photographic Experts Group) image files to the flash drive.
```
copy *.jpg f:
```
- [How to change drives in MS-DOS and Windows command line.](https://www.computerhope.com/issues/ch000515.htm)
### 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](https://www.computerhope.com/jargon/b/backup.htm) copy of the file.
### Related pages and help
- See the [cd command](https://www.computerhope.com/cdhlp.htm), [dir command](https://www.computerhope.com/dirhlp.htm), [copy command](https://www.computerhope.com/copyhlp.htm), and [xcopy command](https://www.computerhope.com/xcopyhlp.htm) pages for further information about each MS-DOS command.
- [How to use the Windows command line (DOS).](https://www.computerhope.com/issues/chusedos.htm)
## Batch file
To perform any copy command in a batch file, include any of the [Windows command line copy commands](https://www.computerhope.com/issues/ch000766.htm#command-line) above in a batch file.
- [How to make a batch file.](https://www.computerhope.com/issues/ch001666.htm)
## How to copy files in Linux and Unix

Below are steps to copy a single file from one directory to another directory in Linux and Unix.
### Copying a single file from one location to another
1. Using the [cd command](https://www.computerhope.com/unix/ucd.htm), move to the directory containing the file you want to copy.
2. Type a command similar to the following.
```
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](https://www.computerhope.com/jargon/d/director.htm). To see files available in the [current directory](https://www.computerhope.com/jargon/c/currentd.htm), use the [ls command](https://www.computerhope.com/unix/uls.htm).
### Copying multiple files to another location
Below are the steps to copy multiple files from one directory to another directory.
1. Using the [cd command](https://www.computerhope.com/unix/ucd.htm), move to the directory containing the files you want to copy.
2. Once in the directory containing the files you want to copy, type a command similar to one of the following commands.
```
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.
For additional examples of wildcard characters, see our [wildcard](https://www.computerhope.com/jargon/w/wildcard.htm) definition.
### Copying files with spaces in the file names
Often, you can encounter a file with spaces in the file name. To copy these files, surround the full file name and [file extension](https://www.computerhope.com/jargon/f/fileext.htm) in [quotes](https://www.computerhope.com/jargon/q/quote.htm).
```
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](https://www.computerhope.com/jargon/w/whitspac.htm) (spaces), so the name is enclosed in quotes.
### How to make a copy of a file into the same directory
```
cp 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](https://www.computerhope.com/jargon/b/backup.htm) copy of the file.
### Related pages and help
- See the [cd command](https://www.computerhope.com/unix/ucd.htm), [cp command](https://www.computerhope.com/unix/ucp.htm), and [ls command](https://www.computerhope.com/unix/uls.htm) pages for additional information about these commands.
- For general help using the Linux command line, see our [Linux and Unix shell tutorial.](https://www.computerhope.com/issues/chshell.htm)
## How to copy files in Apple macOS
### Drag-and-drop
[Highlight](https://www.computerhope.com/jargon/h/highligh.htm) 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](https://www.computerhope.com/jargon/d/dragdrop.htm) 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.
1. Highlight the files you want to copy.
2. Press the keyboard shortcut [`Command`\+`C`](https://www.computerhope.com/jargon/c/cmd-c.htm).
3. Navigate to the location where you want to move the files.
4. Press [`Command`\+`V`](https://www.computerhope.com/jargon/c/cmd-v.htm) to [paste](https://www.computerhope.com/jargon/p/paste.htm) the copied files.
### Terminal
To copy files in a [Terminal](https://www.computerhope.com/jargon/t/terminal.htm) session, use the [cp command](https://www.computerhope.com/unix/ucp.htm). |
| Shard | 155 (laksa) |
| Root Hash | 10279792605394887355 |
| Unparsed URL | com,computerhope!www,/issues/ch000766.htm s443 |