Prompt to confirm copy even with cp -f?

Wow – I get so frustrated when I try to copy some files over old ones and I get:

[root@server1 wordpress]# cp -Rf * ../public_html/
cp: overwrite `../public_html/license.txt'? y

-R is recursive, but -f is supposed to copy over without confirmation. What could it be?!

Check out your alias command using ‘alias’:

[root@server1 wordpress]# alias
alias cp='cp -i'

Sure enough – alias is set on Redhat Based systems into -i, or interactive mode. Remove this alias with ‘unalias cp’ and it will be removed.

Happy copying!

Share and Enjoy:
  • Twitter
  • del.icio.us
  • Digg
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • StumbleUpon

1 Trackbacks

You can leave a trackback using this URL: http://systembash.com/content/prompt-to-confirm-copy-even-with-cp-f/trackback/

  1. By Dave Drager on April 8, 2008 at 7:35 pm

    New blog post: Prompt to confirm copy even with cp -f? http://tinyurl.com/5qwq43

2 Comments

  1. Anstar

    also you can use full path to command:
    /bin/cp -Rf * ../public_html/

    in this case alias will not work :)

    Posted July 4, 2008 at 3:22 pm | Permalink
  2. mandy

    Hi,
    I am also looking for the solution for the above code.Did you get the chance to write the bash script for that .If possible send me that program it would be very helpful for me.

    Thanks

    Posted June 4, 2009 at 4:37 pm | Permalink

Post a Comment

Your email is never shared. Required fields are marked *

*
*