|
Home > Archive > Red Hat Topics > October 2005 > remove prompting overwrite with "cp"
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
remove prompting overwrite with "cp"
|
|
| fongjengkum@gmail.com 2005-10-24, 9:35 am |
| I tried "cp -f -r /home/username/* /home/anotherusername", still I get
the message prompting to overwrite the same file.
Is there a way to force it to overwrite the file without prompting the
message? This is very annoying if there are hundreds of files to
overwrite.
TIA.
| |
| Lenard 2005-10-24, 9:35 am |
| fongjengkum@gmail.com wrote:
> I tried "cp -f -r /home/username/* /home/anotherusername", still I get
> the message prompting to overwrite the same file.
>
> Is there a way to force it to overwrite the file without prompting the
> message? This is very annoying if there are hundreds of files to
> overwrite.
From 'man cp';
--reply={yes,no,query}
specify how to handle the prompt about an existing destination
file
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
| |
| Robert Nichols 2005-10-24, 9:35 am |
| In article <1129797961.384812.246070@g14g2000cwa.googlegroups.com>,
<fongjengkum@gmail.com> wrote:
:I tried "cp -f -r /home/username/* /home/anotherusername", still I get
:the message prompting to overwrite the same file.
:
:Is there a way to force it to overwrite the file without prompting the
:message? This is very annoying if there are hundreds of files to
:overwrite.
unalias cp
cp -f -r /home/username/* /home/anotherusername
or else
/bin/cp -f -r /home/username/* /home/anotherusername
--
Bob Nichols AT comcast.net I am "RNichols42"
| |
| Spamless 2005-10-24, 9:35 am |
| On 2005-10-20, Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> wrote:
> In article <1129797961.384812.246070@g14g2000cwa.googlegroups.com>,
> <fongjengkum@gmail.com> wrote:
>:I tried "cp -f -r /home/username/* /home/anotherusername", still I get
>:the message prompting to overwrite the same file.
>:
>:Is there a way to force it to overwrite the file without prompting the
>:message? This is very annoying if there are hundreds of files to
>:overwrite.
>
> unalias cp
> cp -f -r /home/username/* /home/anotherusername
>
> or else
>
> /bin/cp -f -r /home/username/* /home/anotherusername
or \cp -f -r /home/username/* /home/anotherusername
(at least in the tcshell \name uses the original "name" function,
not the alias)
| |
| Robert Nichols 2005-10-24, 9:35 am |
| In article <YdW5f.209$ZA3.47175@monger.newsread.com>,
Spamless <Spamless@Nil.nil> wrote:
:On 2005-10-20, Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> wrote:
:> In article <1129797961.384812.246070@g14g2000cwa.googlegroups.com>,
:> <fongjengkum@gmail.com> wrote:
:>:I tried "cp -f -r /home/username/* /home/anotherusername", still I get
:>:the message prompting to overwrite the same file.
:>:
:>:Is there a way to force it to overwrite the file without prompting the
:>:message? This is very annoying if there are hundreds of files to
:>:overwrite.
:>
:> unalias cp
:> cp -f -r /home/username/* /home/anotherusername
:>
:> or else
:>
:> /bin/cp -f -r /home/username/* /home/anotherusername
:
:or \cp -f -r /home/username/* /home/anotherusername
at least in the tcshell \name uses the original "name" function,
:not the alias)
That's true in bash, too. There are many ways to avoid the problem
once one realizes that it's due to an alias.
--
Bob Nichols AT comcast.net I am "RNichols42"
|
|
|
|
|