Why does 'cp -f' not work anymore?

Mark Farmer farmerma at cromwell.co.uk
Thu Nov 3 12:54:34 UTC 2005


Chris W. Parker wrote:
> Cameron Simpson <mailto:cs at zip.com.au>
>     on Tuesday, November 01, 2005 4:32 PM said:
> 
> 
>>Even easier is to quote just one character instead of the whole word:
>>
>>  \cp -f newfile.txt this-has-to-go.txt
> 
> 
> I've sinced just changed the original alias to be only 'cp' (although I
> guess I might as well get rid of the alias altogether...).
> 
> But what I'm finding now is that it's not confirming an overwrite at all
> now.
> 
> Originally the problem was that even 'cp -f' resulted in an overwrite
> confirmation. What I want to happen is that 'cp' will ask me for
> permission to overwrite and 'cp -f' will not. Is that possible? Or do I
> just have to remember to type 'cp -i'?

I came accross this when setting up an nfs installation directory.
The alias can easily be bypassed by giving the path to the command:

/bin/cp

Then you could simply choose to add -i (/bin/cp -i) if you want to confirm a file
overwrite.

This is the method I use, it's simple, no hassle & puts me in control of what happens :-)
Of course it may not be appropriate for more complex situations.

HTH

-- 
Mark Farmer
Linux System Administrator
Cromwell Group (Holdings) LTD
65 Chartwell Drive
Wigston
Leicester
LE18 1AT
Tel: (+44) 0116 2572386
Fax: (+44) 0116 2572409
Email: <farmerma |AT| cromwell |DOT| co |DOT| uk>
www.cromwell.co.uk

___________________________________________________ 
  
This email is intended for the named recipient. The information contained 
in it is confidential.  You should not copy it for any purposes, nor 
disclose its contents to any other party.  If you received this email 
in error, please notify the sender immediately via email, and delete it from
your computer. 
  
Any views or opinions presented are solely those of the author and do not 
necessarily represent those of the company. 
  
Registered Office: PO Box 14, Chartwell Dr, Wigston, Leicester. LE18 1AT 
__________________________________________________




More information about the redhat-list mailing list