âšď¸ 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.1 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://runcloud.io/blog/copy-files-in-linux |
| Last Crawled | 2026-04-08 10:14:19 (2 days ago) |
| First Indexed | 2024-01-31 05:43:17 (2 years ago) |
| HTTP Status Code | 200 |
| Meta Title | How to Copy Files in Linux and Overwrite without Confirmation |
| Meta Description | Are you working on a bash script that needs to be executed without any human inputs? Do your scripts fail when the process of copying files encounters a |
| Meta Canonical | null |
| Boilerpipe Text | Are you working on a bash script that needs to be executed without any human inputs? Do your scripts fail when the process of copying files encounters a problem?
Table of Contents
How to Copy Files in Linux CLI
How to Overwrite Existing Files
Changing the Default Behavior
Checking For An Existing Alias
Removing An Alias
Temporarily Bypass An Alias
Automatically Accepting All Prompts
Wrapping Up
If you answered âyesâ to either of these questions then youâre in the right place.
In this post, we will take a quick look at the cp command in Linux, and examine how it can be used in different scenarios.
How to Copy Files in Linux CLI
Copying files is one of the simplest actions that you can perform on a computer. To copy files via the command line you can use the cp command, which stands for âcopyâ. The general syntax for the cp command is:
cp
[
OPTIONS
]
SOURCE
(
s
)
.
.
.
DESTINATION
The
SOURCE(s)
can be
one or more files or directories
, and the
DESTINATION
can be a single file or directory. If youâve passed more than two parameters to the command, then the last one is always considered the destination, and all other parameters before it are considered the source(s).
If the
DESTINATION
is a directory, the
SOURCE
files or directories
are copied into it.
If the
DESTINATION
is a file, the
SOURCE
file
is copied and renamed as the
DESTINATION
file.
Here is a simple example of how to copy a file named
file.txt
from the current directory to another directory named backup:
cp
file
.
txt
backup
/
This will copy the file
file.txt
to the
backup
directory with the same name. If you want to copy the file with a different name, you can specify the new name after the backup directory:
cp
file
.
txt
backup
/
new_file
.
txt
This will copy the file
file.txt
to the backup directory as
new_file.txt
.
How to Overwrite Existing Files
By default,
cp
will overwrite any existing files in the destination without asking for confirmation. However, this behavior can be changed by using different flags or options with the
cp
command. Here are some of the common flags that can affect how
cp
handles overwriting:
-f
or
--force
: This option will force cp to
overwrite any existing files
in the destination, even if they cannot be opened or removed. This option will also ignore any
-n
option that is used before it.
For example,
cp -f source.txt destination.txt
will overwrite
destination.txt
with
source.txt
, regardless of any permissions or errors.
-i
or
--interactive
: This option will make cp
prompt the user
before overwriting any existing files in the destination. You can choose to overwrite or skip the file by typing
y
or
n
and then pressing Enter.
If youâre copying multiple files at once, you will be prompted for each file separately. If you donât type anything and press Enter then the file will not be overwritten.
This option will also override any
-n
option that is used before it. For example,
cp -i source.txt destination.txt
will ask the user if they want to overwrite
destination.txt
with
source.txt
, and proceed accordingly.
-n
or
--no-clobber
: This option will
prevent cp from overwriting
any existing files in the destination. If the destination file already exists, cp will skip it and move on to the next file. This option will also override any
-i
option that is used before it.
For example,
cp -n source.txt destination.txt
will
not
overwrite
destination.txt
with
source.txt
, if
destination.txt
already exists.
-u
or
--update
: This option will make cp
copy only when the source file is newer
than the destination file, or when the destination file does not exist. This can be useful for updating or synchronizing files between different locations.
For example,
cp -u source.txt destination.txt
will overwrite
destination.txt
with
source.txt
, only if
source.txt
is newer or
destination.txt
does not exist.
Note that these flags can be combined to achieve different effects. For example,
cp -uf source.txt destination.txt
will force cp to overwrite
destination.txt
with
source.txt
, only if
source.txt
is newer or
destination.txt
does not exist.
Changing the Default Behavior
On some computers, the default behavior of the cp command can be affected by an
alias
. An alias is a way of creating a shortcut or a new name for a command, with some predefined options.
For example, some Linux distributions come with the following alias pre-defined in their code:
alias
cp
=
'cp -i'
This means that whenever the user types
cp
, the shell will actually run
cp -i
, which will prompt the user before overwriting any files.
Checking For An Existing Alias
If youâre not sure whether your computer has a predefined alias, then you can run the following command to list all aliases, and then look to see whether the cp is present in the output:
alias
Removing An Alias
To remove the alias for
cp
, you can run the command
unalias cp
, which will restore the default behavior of
cp
.
In the above example, we can see that an alias was defined for the
cp
command. After executing the
unalias
command, the alias entry was removed from the list.
Temporarily Bypass An Alias
If you donât want to permanently remove the alias, you have an option to use a backslash before the cp command to bypass the alias and run the original command. For example,
\cp source.txt destination.txt
will overwrite
destination.txt
with
source.txt
, without prompting the user.
In the above example, we can see that the user was prompted for input when executing the copy operation, but not when the command was prefixed with the \ character.
Automatically Accepting All Prompts
In Linux there are multiple ways to do the same thing using different methods. If you donât want to use the in-built
-f
option to overwrite files then you can use the
copy
command in conjunction with the
yes
command to automatically respond with y to all prompts.
yes
|
cp
-
v
source
destination
In the above example, we can see that the copy command prompted us for input before replacing each file, but the yes command responded âyesâ to each and every single one of them nearly instantaneously.
Wrapping Up
In this article, we have discussed how to copy files and directories in Linux via the command line. We have also explained different options and features of the copy command that are helpful in day-to-day usage.
If youâre learning Linux to better manage your servers, we wish you all the best! However, you donât need to be a Linux expert to host websites on the internet. RunCloud makes it extremely easy to deploy and manage websites
using a user-friendly dashboard,
and provides
complete freedom
to tinker under the hood.
Whether youâre a beginner or a seasoned professional with decades of experience, sooner or later everyone makes a configuration change that completely renders websites useless. RunCloud has
idiot-proofed many complex operations
such as updating server configurations, installing SSL certificates, deleting applications, etc. â all of which makes it difficult for novice users to crash their website, and provides an extra set of guide-rails to advanced users.
RunCloud is a versatile and reliable tool that can help you manage your server on your own, without the hassle and cost of hiring a system administrator. Donât miss this opportunity to take your server management to the next level.
Sign up for RunCloud today
and enjoy the benefits of a cloud-based server management platform that is fast, secure, and easy to use. |
| Markdown | [Blog](https://runcloud.io/blog)
Search...
`Ctrl` `+`
#### Start typing to begin search
Enter a search term to find results
in the blog.
- [Products]()
#### Modern server management panel
The enterprise-grade platform for server management.
[Server Management](https://runcloud.io/server-management)
[Backup](https://runcloud.io/backup)
[Atomic Deployment](https://runcloud.io/atomic-deployment)
[Team](https://runcloud.io/team)
[Arch](https://runcloud.io/arch)
[RunCache](https://runcloud.io/runcache)
[Migration](https://runcloud.io/migration)
- [Resources]()
#### Resources
Get help and learn more about our products offering.
[Blog](https://runcloud.io/blog)
[Documentation](https://runcloud.io/docs)
[API & Developers](https://runcloud.io/docs/api)
[Changelog](https://runcloud.io/changelog)
[Community](https://community.runcloud.io/)
[Status Page](https://status.runcloud.io/)
- [Pricing](https://runcloud.io/pricing)
- [Company]()
#### Company
Get help and learn more about our products offering.
[About Us](https://runcloud.io/company)
[Ambassadors](https://runcloud.io/company/ambassador)
[Career](https://runcloud.io/careers)
[Legal](https://runcloud.io/legal/tos)
[Newsroom](https://runcloud.io/company/newsroom)
[Bug Bounty Programme](https://runcloud.io/bug-bounty-programme)
[Trust & Security](https://runcloud.io/security)
[Education](https://runcloud.io/education)
[Contact Us](mailto:hello@runcloud.io?subject=[Hello])
- [Login](https://manage.runcloud.io/auth/login?utm_source=runcloudwebsite&utm_medium=blog&utm_campaign=blog-header)
- [Get Started](https://manage.runcloud.io/auth/onboard?utm_source=runcloudwebsite&utm_medium=blog&utm_campaign=blog-header)
- [All Posts](https://runcloud.io/blog)
- [News](https://runcloud.io/blog/category/new)
- [Server Management](https://runcloud.io/blog/category/server-management)
- [WordPress](https://runcloud.io/blog/category/wordpress)
- [Security](https://runcloud.io/blog/category/security)
- [Laravel](https://runcloud.io/blog/category/laravel)
- [Cloud Education](https://runcloud.io/blog/category/tutorial)
- [Server Management](https://runcloud.io/blog/category/server-management)
- â˘
- [Tips & Tricks](https://runcloud.io/blog/category/tips-tricks)
# How to Copy Files in Linux and Overwrite without Confirmation

RunCloud Team
- Last Updated Feb 29, 2024
- â˘
- Reading Time 5 min read
Are you working on a bash script that needs to be executed without any human inputs? Do your scripts fail when the process of copying files encounters a problem?
Table of Contents
- [How to Copy Files in Linux CLI](https://runcloud.io/blog/copy-files-in-linux#how-to-copy-files-in-linux-cli)
- [How to Overwrite Existing Files](https://runcloud.io/blog/copy-files-in-linux#how-to-overwrite-existing-files)
- [Changing the Default Behavior](https://runcloud.io/blog/copy-files-in-linux#changing-the-default-behavior)
- [Checking For An Existing Alias](https://runcloud.io/blog/copy-files-in-linux#checking-for-an-existing-alias)
- [Removing An Alias](https://runcloud.io/blog/copy-files-in-linux#removing-an-alias)
- [Temporarily Bypass An Alias](https://runcloud.io/blog/copy-files-in-linux#temporarily-bypass-an-alias)
- [Automatically Accepting All Prompts](https://runcloud.io/blog/copy-files-in-linux#automatically-accepting-all-prompts)
- [Wrapping Up](https://runcloud.io/blog/copy-files-in-linux#wrapping-up)
If you answered âyesâ to either of these questions then youâre in the right place.
In this post, we will take a quick look at the cp command in Linux, and examine how it can be used in different scenarios.
## **How to Copy Files in Linux CLI**
Copying files is one of the simplest actions that you can perform on a computer. To copy files via the command line you can use the cp command, which stands for âcopyâ. The general syntax for the cp command is:
```
cp [OPTIONS] SOURCE(s)... DESTINATIONCopy
```
The `SOURCE(s)` can be **one or more files or directories**, and the `DESTINATION` can be a single file or directory. If youâve passed more than two parameters to the command, then the last one is always considered the destination, and all other parameters before it are considered the source(s).
- If the `DESTINATION` is a directory, the `SOURCE` **files or directories** are copied into it.
- If the `DESTINATION` is a file, the `SOURCE` **file** is copied and renamed as the `DESTINATION` file.
Here is a simple example of how to copy a file named `file.txt` from the current directory to another directory named backup:
```
cp file.txt backup/Copy
```
This will copy the file `file.txt` to the `backup` directory with the same name. If you want to copy the file with a different name, you can specify the new name after the backup directory:
```
cp file.txt backup/new_file.txtCopy
```
This will copy the file `file.txt` to the backup directory as `new_file.txt`.
## **How to Overwrite Existing Files**
By default, `cp` will overwrite any existing files in the destination without asking for confirmation. However, this behavior can be changed by using different flags or options with the `cp` command. Here are some of the common flags that can affect how `cp` handles overwriting:
- **`-f` or `--force`**: This option will force cp to **overwrite any existing files** in the destination, even if they cannot be opened or removed. This option will also ignore any `-n` option that is used before it.
For example, `cp -f source.txt destination.txt` will overwrite *destination.txt* with *source.txt*, regardless of any permissions or errors.
- **`-i` or `--interactive`**: This option will make cp **prompt the user** before overwriting any existing files in the destination. You can choose to overwrite or skip the file by typing `y` or `n` and then pressing Enter.
If youâre copying multiple files at once, you will be prompted for each file separately. If you donât type anything and press Enter then the file will not be overwritten.
This option will also override any `-n` option that is used before it. For example, `cp -i source.txt destination.txt` will ask the user if they want to overwrite *destination.txt* with *source.txt*, and proceed accordingly.
- **`-n` or `--no-clobber`**: This option will **prevent cp from overwriting** any existing files in the destination. If the destination file already exists, cp will skip it and move on to the next file. This option will also override any `-i` option that is used before it.
For example, `cp -n source.txt destination.txt` will **not** overwrite *destination.txt* with *source.txt*, if *destination.txt* already exists.
- **`-u` or `--update`**: This option will make cp **copy only when the source file is newer** than the destination file, or when the destination file does not exist. This can be useful for updating or synchronizing files between different locations.
For example, `cp -u source.txt destination.txt` will overwrite *destination.txt* with *source.txt*, only if *source.txt* is newer or *destination.txt* does not exist.
Note that these flags can be combined to achieve different effects. For example, `cp -uf source.txt destination.txt` will force cp to overwrite *destination.txt* with *source.txt*, only if *source.txt* is newer or *destination.txt* does not exist.
## **Changing the Default Behavior**
On some computers, the default behavior of the cp command can be affected by an **alias**. An alias is a way of creating a shortcut or a new name for a command, with some predefined options.
For example, some Linux distributions come with the following alias pre-defined in their code:
```
alias cp='cp -i'Copy
```
This means that whenever the user types `cp`, the shell will actually run `cp -i`, which will prompt the user before overwriting any files.
### **Checking For An Existing Alias**
If youâre not sure whether your computer has a predefined alias, then you can run the following command to list all aliases, and then look to see whether the cp is present in the output:
```
aliasCopy
```

### **Removing An Alias**
To remove the alias for `cp`, you can run the command `unalias cp`, which will restore the default behavior of `cp`.

In the above example, we can see that an alias was defined for the `cp` command. After executing the `unalias` command, the alias entry was removed from the list.
### **Temporarily Bypass An Alias**
If you donât want to permanently remove the alias, you have an option to use a backslash before the cp command to bypass the alias and run the original command. For example, `\cp source.txt destination.txt` will overwrite *destination.txt* with *source.txt*, without prompting the user.

In the above example, we can see that the user was prompted for input when executing the copy operation, but not when the command was prefixed with the \\ character.
### **Automatically Accepting All Prompts**
In Linux there are multiple ways to do the same thing using different methods. If you donât want to use the in-built `-f` option to overwrite files then you can use the **copy** command in conjunction with the **yes** command to automatically respond with y to all prompts.
```
yes | cp -v source destinationCopy
```

In the above example, we can see that the copy command prompted us for input before replacing each file, but the yes command responded âyesâ to each and every single one of them nearly instantaneously.
## **Wrapping Up**
In this article, we have discussed how to copy files and directories in Linux via the command line. We have also explained different options and features of the copy command that are helpful in day-to-day usage.
If youâre learning Linux to better manage your servers, we wish you all the best! However, you donât need to be a Linux expert to host websites on the internet. RunCloud makes it extremely easy to deploy and manage websites **using a user-friendly dashboard,** and provides **complete freedom** to tinker under the hood.
Whether youâre a beginner or a seasoned professional with decades of experience, sooner or later everyone makes a configuration change that completely renders websites useless. RunCloud has **idiot-proofed many complex operations** such as updating server configurations, installing SSL certificates, deleting applications, etc. â all of which makes it difficult for novice users to crash their website, and provides an extra set of guide-rails to advanced users.
RunCloud is a versatile and reliable tool that can help you manage your server on your own, without the hassle and cost of hiring a system administrator. Donât miss this opportunity to take your server management to the next level. [Sign up for RunCloud today](https://manage.runcloud.io/auth/onboard) and enjoy the benefits of a cloud-based server management platform that is fast, secure, and easy to use.
## About the author(s)

RunCloud TeamAuthor
### Deploy & manage production-grade cloud infrastructure.
Trusted by brands from startup to enterprise. With everything from backups, staging, cloning, atomic deployments, and more â RunCloud makes it easy to manage your own production-grade infrastructure.
[Get Started Now](https://manage.runcloud.io/auth/onboard?utm_source=runcloudwebsite&utm_medium=blog&utm_campaign=blog-sidebar)
Posts you may like
[Security  RunCloud Team Jan 25, 2022 14 min read 23 Best Chrome Extensions To Protect Your PrivacyAre you looking for extensions to enhance your security and privacy? Although Incognito Mode aims at making your browsing experience secure, sometimes it just isnât enough. Chrome may be the worldâs most popular web browser, but it isnât the most private one. It does, however, provide a number of Chrome extensions that you can freely âŚ](https://runcloud.io/blog/best-chrome-privacy-extensions)
[Server Management  RunCloud Team Oct 12, 2025 ⢠12 min read How to Fix the âERR\_NAME\_NOT\_RESOLVEDâ ErrorThe ERR\_NAME\_NOT\_RESOLVED is a frustrating error message that prevents you from browsing the web. The good news is that this error is almost always fixable, and you donât need to be a tech expert to do it. This post will show you exactly how to fix the ERR\_NAME\_NOT\_RESOLVED error. We will walk you through a âŚ](https://runcloud.io/blog/fix-err_name_not_resolved-error)
[Server Management  RunCloud Team Aug 23, 2022 ⢠2 min read Cheat Sheet To All Bash Shortcuts You Should KnowThe Linux Bash is commonly used by developers, though it may seem fairly difficult to navigate at first. The use of arrow keys to navigate between commands is obviously a hassle and often becomes a major challenge. However, in general, Bash is quite easy to use. If youâre going to use it on a VPS, âŚ](https://runcloud.io/blog/bash-shortcuts-cheat-sheet)
[Server Management  RunCloud Team Sep 19, 2024 ⢠6 min read How to Check Running Processes in Linux Using ps, top, htop, and atop CommandsIf youâre involved with managing servers, then youâll already be aware of how little servers offer as far as user interfaces are concerned. Most of the work necessitates the use of the command line interface. When monitoring servers, you often need to track multiple things simultaneously, such as disk usage, network, CPU temperatures, etc. While âŚ](https://runcloud.io/blog/running-processes-in-linux)
[Server Management  RunCloud Team Jan 23, 2026 ⢠7 min read Fix âThis Site Canât Be Reachedâ Error (5+ Reliable Solutions That Actually Work)Are you seeing the âThis site canât be reachedâ error on your site? This error is frustrating and can have multiple underlying causes, which makes troubleshooting harder. In this guide, we break those causes down and show you how to fix them. By the end of this guide, youâll know how to flush DNS cache, âŚ](https://runcloud.io/blog/fix-this-site-cant-be-reached-error)
[Server Management  RunCloud Team Mar 08, 2024 ⢠5 min read How To Host Matomo Analytics On A RunCloud ServerIf you answered âYes!â to either of these questions, then youâre in the right place. Matomo is a free and open source web analytics platform that gives you insights into your websiteâs visitors, behavior, and conversions. In this post, we will show you how to host Matomo analytics on a RunCloud server and enjoy the âŚ](https://runcloud.io/blog/host-matomo-analytics)
## Comments
### Add to discussion
Your email address will not be published
Š 2026 RunCloud Sdn Bhd
- [Terms of Service](https://runcloud.io/legal/tos)
- [Privacy Policy](https://runcloud.io/legal/privacy-policy)
- [Cookie Policy](https://runcloud.io/legal/cookie-policy) |
| Readable Markdown | Are you working on a bash script that needs to be executed without any human inputs? Do your scripts fail when the process of copying files encounters a problem?
Table of Contents
- [How to Copy Files in Linux CLI](https://runcloud.io/blog/copy-files-in-linux#how-to-copy-files-in-linux-cli)
- [How to Overwrite Existing Files](https://runcloud.io/blog/copy-files-in-linux#how-to-overwrite-existing-files)
- [Changing the Default Behavior](https://runcloud.io/blog/copy-files-in-linux#changing-the-default-behavior)
- [Checking For An Existing Alias](https://runcloud.io/blog/copy-files-in-linux#checking-for-an-existing-alias)
- [Removing An Alias](https://runcloud.io/blog/copy-files-in-linux#removing-an-alias)
- [Temporarily Bypass An Alias](https://runcloud.io/blog/copy-files-in-linux#temporarily-bypass-an-alias)
- [Automatically Accepting All Prompts](https://runcloud.io/blog/copy-files-in-linux#automatically-accepting-all-prompts)
- [Wrapping Up](https://runcloud.io/blog/copy-files-in-linux#wrapping-up)
If you answered âyesâ to either of these questions then youâre in the right place.
In this post, we will take a quick look at the cp command in Linux, and examine how it can be used in different scenarios.
## **How to Copy Files in Linux CLI**
Copying files is one of the simplest actions that you can perform on a computer. To copy files via the command line you can use the cp command, which stands for âcopyâ. The general syntax for the cp command is:
```
cp [OPTIONS] SOURCE(s)... DESTINATION
```
The `SOURCE(s)` can be **one or more files or directories**, and the `DESTINATION` can be a single file or directory. If youâve passed more than two parameters to the command, then the last one is always considered the destination, and all other parameters before it are considered the source(s).
- If the `DESTINATION` is a directory, the `SOURCE` **files or directories** are copied into it.
- If the `DESTINATION` is a file, the `SOURCE` **file** is copied and renamed as the `DESTINATION` file.
Here is a simple example of how to copy a file named `file.txt` from the current directory to another directory named backup:
```
cp file.txt backup/
```
This will copy the file `file.txt` to the `backup` directory with the same name. If you want to copy the file with a different name, you can specify the new name after the backup directory:
```
cp file.txt backup/new_file.txt
```
This will copy the file `file.txt` to the backup directory as `new_file.txt`.
## **How to Overwrite Existing Files**
By default, `cp` will overwrite any existing files in the destination without asking for confirmation. However, this behavior can be changed by using different flags or options with the `cp` command. Here are some of the common flags that can affect how `cp` handles overwriting:
- **`-f` or `--force`**: This option will force cp to **overwrite any existing files** in the destination, even if they cannot be opened or removed. This option will also ignore any `-n` option that is used before it.
For example, `cp -f source.txt destination.txt` will overwrite *destination.txt* with *source.txt*, regardless of any permissions or errors.
- **`-i` or `--interactive`**: This option will make cp **prompt the user** before overwriting any existing files in the destination. You can choose to overwrite or skip the file by typing `y` or `n` and then pressing Enter.
If youâre copying multiple files at once, you will be prompted for each file separately. If you donât type anything and press Enter then the file will not be overwritten.
This option will also override any `-n` option that is used before it. For example, `cp -i source.txt destination.txt` will ask the user if they want to overwrite *destination.txt* with *source.txt*, and proceed accordingly.
- **`-n` or `--no-clobber`**: This option will **prevent cp from overwriting** any existing files in the destination. If the destination file already exists, cp will skip it and move on to the next file. This option will also override any `-i` option that is used before it.
For example, `cp -n source.txt destination.txt` will **not** overwrite *destination.txt* with *source.txt*, if *destination.txt* already exists.
- **`-u` or `--update`**: This option will make cp **copy only when the source file is newer** than the destination file, or when the destination file does not exist. This can be useful for updating or synchronizing files between different locations.
For example, `cp -u source.txt destination.txt` will overwrite *destination.txt* with *source.txt*, only if *source.txt* is newer or *destination.txt* does not exist.
Note that these flags can be combined to achieve different effects. For example, `cp -uf source.txt destination.txt` will force cp to overwrite *destination.txt* with *source.txt*, only if *source.txt* is newer or *destination.txt* does not exist.
## **Changing the Default Behavior**
On some computers, the default behavior of the cp command can be affected by an **alias**. An alias is a way of creating a shortcut or a new name for a command, with some predefined options.
For example, some Linux distributions come with the following alias pre-defined in their code:
```
alias cp='cp -i'
```
This means that whenever the user types `cp`, the shell will actually run `cp -i`, which will prompt the user before overwriting any files.
### **Checking For An Existing Alias**
If youâre not sure whether your computer has a predefined alias, then you can run the following command to list all aliases, and then look to see whether the cp is present in the output:
```
alias
```

### **Removing An Alias**
To remove the alias for `cp`, you can run the command `unalias cp`, which will restore the default behavior of `cp`.

In the above example, we can see that an alias was defined for the `cp` command. After executing the `unalias` command, the alias entry was removed from the list.
### **Temporarily Bypass An Alias**
If you donât want to permanently remove the alias, you have an option to use a backslash before the cp command to bypass the alias and run the original command. For example, `\cp source.txt destination.txt` will overwrite *destination.txt* with *source.txt*, without prompting the user.

In the above example, we can see that the user was prompted for input when executing the copy operation, but not when the command was prefixed with the \\ character.
### **Automatically Accepting All Prompts**
In Linux there are multiple ways to do the same thing using different methods. If you donât want to use the in-built `-f` option to overwrite files then you can use the **copy** command in conjunction with the **yes** command to automatically respond with y to all prompts.
```
yes | cp -v source destination
```

In the above example, we can see that the copy command prompted us for input before replacing each file, but the yes command responded âyesâ to each and every single one of them nearly instantaneously.
## **Wrapping Up**
In this article, we have discussed how to copy files and directories in Linux via the command line. We have also explained different options and features of the copy command that are helpful in day-to-day usage.
If youâre learning Linux to better manage your servers, we wish you all the best! However, you donât need to be a Linux expert to host websites on the internet. RunCloud makes it extremely easy to deploy and manage websites **using a user-friendly dashboard,** and provides **complete freedom** to tinker under the hood.
Whether youâre a beginner or a seasoned professional with decades of experience, sooner or later everyone makes a configuration change that completely renders websites useless. RunCloud has **idiot-proofed many complex operations** such as updating server configurations, installing SSL certificates, deleting applications, etc. â all of which makes it difficult for novice users to crash their website, and provides an extra set of guide-rails to advanced users.
RunCloud is a versatile and reliable tool that can help you manage your server on your own, without the hassle and cost of hiring a system administrator. Donât miss this opportunity to take your server management to the next level. [Sign up for RunCloud today](https://manage.runcloud.io/auth/onboard) and enjoy the benefits of a cloud-based server management platform that is fast, secure, and easy to use. |
| Shard | 143 (laksa) |
| Root Hash | 15992561546915991943 |
| Unparsed URL | io,runcloud!/blog/copy-files-in-linux s443 |