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!

5 comments
  1. Pingback: Dave Drager
  2. also you can use full path to command:
    /bin/cp -Rf * ../public_html/

    in this case alias will not work :)

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

    in this case alias will not work :)

  4. 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

  5. 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

Comments are closed.

You May Also Like

Attach files to email via command line

This is a pretty simple thing to do, once you’ve figured it…

Awesome article on using the VI Text Editor

Awesome article on using vi/vim: Do whatever you want. Don’t learn it…

Dead linux users?

Not dead as in dead, but dead as in the user has logged out of the system and for some reason their shell is still open. This might happen if your system crashes before you can log out, there are network problems and you are disconnected, or a number of other reasons. This article explains how to log these “dead” shell users out.

.htaccess stupid tips and tricks

Found an encyclopedic list of “stupid” .htaccess tricks. Includes many useful ones…